Share via


IDesignerGlyphProvider.GetGlyphs(ActivityDesigner) 메서드

정의

지정된 Activity Designer와 연결된 문자 모양의 배열을 반환합니다.

public:
 System::Workflow::ComponentModel::Design::ActivityDesignerGlyphCollection ^ GetGlyphs(System::Workflow::ComponentModel::Design::ActivityDesigner ^ activityDesigner);
public System.Workflow.ComponentModel.Design.ActivityDesignerGlyphCollection GetGlyphs (System.Workflow.ComponentModel.Design.ActivityDesigner activityDesigner);
abstract member GetGlyphs : System.Workflow.ComponentModel.Design.ActivityDesigner -> System.Workflow.ComponentModel.Design.ActivityDesignerGlyphCollection
Public Function GetGlyphs (activityDesigner As ActivityDesigner) As ActivityDesignerGlyphCollection

매개 변수

activityDesigner
ActivityDesigner

문자 모양을 검색할 ActivityDesigner 개체입니다.

반환

Activity Designer에 렌더링할 DesignerGlyph 개체의 배열입니다.

예제

다음 코드 예제에서는 Activity Designer 화면에 사용자 지정 문자 모양 개체를 그리기 위해 GetGlyphs 메서드를 구현하는 방법을 보여 줍니다.

이 코드 예제는 DesignerGlyphProvider.cs 파일에 있는 Workflow Monitor 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

적용 대상

추가 정보