DesignerGlyph クラス

定義

注意事項

The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

アクティビティ デザイナーの Z オーダーの最前面にグリフを描画します。

public ref class DesignerGlyph abstract
public abstract class DesignerGlyph
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public abstract class DesignerGlyph
type DesignerGlyph = class
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type DesignerGlyph = class
Public MustInherit Class DesignerGlyph
継承
DesignerGlyph
派生
属性

DesignerGlyph クラスから派生したグリフ クラスのコード例を次に示します。 このコードは、GetBounds メソッドおよび OnPaint メソッドをオーバーライドします。

このコード例は、DesignerGlyphProvider.cs ファイルに含まれている、ワークフロー モニターの SDK サンプルの一部です。 詳細については、「 ワークフロー モニター」を参照してください。

//Define a glyph to show an activity is executing, i.e. not 'closed'
internal sealed class ExecutingGlyph : DesignerGlyph
{
    internal ExecutingGlyph()
    {
    }

    public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
    {
        Rectangle imageBounds = Rectangle.Empty;
        Image image = Resources.Executing;
        if (image != null)
        {
            Size glyphSize = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize;
            imageBounds.Location = new Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2);
            imageBounds.Size = glyphSize;
        }
        return imageBounds;
    }

    protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
    {
        Bitmap bitmap = Resources.Executing;
        bitmap.MakeTransparent(Color.FromArgb(0, 255, 255));
        if (bitmap != null)
            graphics.DrawImage(bitmap, GetBounds(designer, activated), new Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel);
    }
}
'Define a glyph to show an activity is executing, i.e. not 'closed'
Friend Class ExecutingGlyph
    Inherits DesignerGlyph
    Public Overrides Function GetBounds(ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner, ByVal activated As Boolean) As System.Drawing.Rectangle
        Dim imageBounds As Rectangle = Rectangle.Empty
        Dim image As Image = AppResources.Executing
        If Not image Is Nothing Then
            Dim glyphSize As Size = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize
            imageBounds.Location = New Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2)
            imageBounds.Size = glyphSize
        End If
        Return imageBounds
    End Function

    Protected Overrides Sub OnPaint(ByVal graphics As System.Drawing.Graphics, ByVal activated As Boolean, ByVal ambientTheme As System.Workflow.ComponentModel.Design.AmbientTheme, ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner)
        Dim bitmap As Bitmap = AppResources.Executing
        bitmap.MakeTransparent(Color.FromArgb(0, 255, 255))

        If Not bitmap Is Nothing Then
            graphics.DrawImage(bitmap, GetBounds(designer, activated), New Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel)
        End If
    End Sub
End Class

注釈

注意

ここでは、廃止された型と名前空間について説明します。 詳細については、「.NET 4.5 での Windows Workflow Foundation の新機能」を参照してください。

DesignerGlyph クラスは、ワークフロー デザイン サーフェイスで使用されるすべてのデザイナー グリフの基本クラスです。

アクティビティ デザイナーの開発者は、DesignerGlyph から継承したクラスを使用して ActivityDesigner のサーフェイスにカスタム グリフを描画できます。 DesignerGlyph クラスは、こうしたグリフを Z オーダーのトップレベルに描画します。視覚的には、デザイナー上の他のすべてのグリフの上に、カスタム グリフの Priority 値に基づいて配置されます。 Priority プロパティの値が小さいほど優先順位が高いことを示し、グリフはアクティビティ デザイナーの Z オーダーの最前面に描画されます。

注意 (実装者)

DesignerGlyph から継承する場合は、OnPaint(Graphics, Boolean, AmbientTheme, ActivityDesigner) メンバーをオーバーライドする必要があります。

コンストラクター

DesignerGlyph()
古い.

派生クラスとして実装された場合、DesignerGlyph クラスの新しいインスタンスを初期化します。

フィールド

HighestPriority
古い.

DesignerGlyph の最も高くできる優先順位を表します。 この値は定数です。

LowestPriority
古い.

DesignerGlyph の最も低くできる優先順位を表します。 この値は定数です。

NormalPriority
古い.

DesignerGlyph の通常の優先順位を表します。 この値は定数です。

プロパティ

CanBeActivated
古い.

DesignerGlyph が、自身が関連付けられている ActivityDesigner にフォーカスを獲得できるかどうかを示す値を取得します。

Priority
古い.

アクティビティ デザイン サーフェイスでのデザイナー グリフの優先順位設定を取得します。

メソッド

Equals(Object)
古い.

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetBounds(ActivityDesigner, Boolean)
古い.

指定した ActivityDesigner のグリフの境界を返します。

GetHashCode()
古い.

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()
古い.

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()
古い.

現在の Object の簡易コピーを作成します。

(継承元 Object)
OnActivate(ActivityDesigner)
古い.

グリフをアクティブにするアクションが実行されたことを通知します。

OnPaint(Graphics, Boolean, AmbientTheme, ActivityDesigner)
古い.

派生クラスでオーバーライドされると、アクティビティ デザイナー画面にグリフをレンダリングするために必要なタスクを実行します。

ToString()
古い.

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください