IDesignerGlyphProvider インターフェイス

定義

注意事項

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

アクティビティ デザイナーに表示するグリフの配列を生成するのにグリフ プロバイダー クラスが使用するメソッドを定義します。

public interface class IDesignerGlyphProvider
public interface IDesignerGlyphProvider
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public interface IDesignerGlyphProvider
type IDesignerGlyphProvider = interface
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type IDesignerGlyphProvider = interface
Public Interface IDesignerGlyphProvider
属性

次のコード例は、IDesignerGlyphProvider インターフェイスを実装する方法を示しています。 ここでは、GetGlyphs メソッドを実装してアクティビティ デザイナー画面にカスタム グリフ オブジェクトを描画する方法を示しています。

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

//Custom glyphprovider used to draw the monitor glyphs on the designer surface
internal class WorkflowMonitorDesignerGlyphProvider : IDesignerGlyphProvider
{
    private Dictionary<string, ActivityStatusInfo> activityStatusList;

    internal WorkflowMonitorDesignerGlyphProvider(Dictionary<string, ActivityStatusInfo> activityStatusList)
    {
        this.activityStatusList = activityStatusList;
    }

    ActivityDesignerGlyphCollection IDesignerGlyphProvider.GetGlyphs(ActivityDesigner activityDesigner)
    {
        ActivityDesignerGlyphCollection glyphList = new ActivityDesignerGlyphCollection();

        //Walk all of the activities and use the 'CompletedGlyph' for all activities that are not 'closed'
        foreach (ActivityStatusInfo activityStatus in activityStatusList.Values)
        {
            if (activityStatus.Name == activityDesigner.Activity.QualifiedName)
            {
                if (activityStatus.Status == "Closed")
                    glyphList.Add(new CompletedGlyph());
                else
                    glyphList.Add(new ExecutingGlyph());
            }
        }

        return glyphList;
    }
}
'Custom glyphprovider used to draw the monitor glyphs on the designer surface
Friend Class WorkflowMonitorDesignerGlyphProvider
    Implements IDesignerGlyphProvider

    Dim activityStatusList As Dictionary(Of String, ActivityStatusInfo)

    Friend Sub New(ByVal activityStatusList As Dictionary(Of String, ActivityStatusInfo))
        Me.activityStatusList = activityStatusList
    End Sub
    Public Function GetGlyphs(ByVal activityDesigner As System.Workflow.ComponentModel.Design.ActivityDesigner) As System.Workflow.ComponentModel.Design.ActivityDesignerGlyphCollection Implements System.Workflow.ComponentModel.Design.IDesignerGlyphProvider.GetGlyphs
        Dim glyphList As ActivityDesignerGlyphCollection = New ActivityDesignerGlyphCollection()

        'Walk all of the activities and use the 'CompletedGlyph' for all activities that are not 'closed'
        For Each activityStatus As ActivityStatusInfo In activityStatusList.Values
            If activityStatus.Name = activityDesigner.Activity.Name Then
                If activityStatus.Status = "Closed" Then
                    glyphList.Add(New CompletedGlyph())
                Else
                    glyphList.Add(New ExecutingGlyph())
                End If
            End If
        Next

        Return glyphList
    End Function
End Class

注釈

注意

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

このインターフェイスは、実装クラスがアクティビティ デザイナーに DesignerGlyph オブジェクトの適切なセットを提供するために使用する必要があるメソッドを定義します。 実装クラスは DesignerGlyph オブジェクトに ActivityDesigner オブジェクトもレンダリングする必要があります。

メソッド

GetGlyphs(ActivityDesigner)
古い.

指定したアクティビティ デザイナーに関連付けられたグリフの配列を返します。

適用対象

こちらもご覧ください