Share via


IDesignerGlyphProvider.GetGlyphs(ActivityDesigner) Methode

Definition

Gibt ein Array von Symbolen zurück, die dem angegebenen Aktivitätsdesigner zugeordnet sind.

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

Parameter

activityDesigner
ActivityDesigner

Das ActivityDesigner-Objekt, für das die Symbole abgerufen werden.

Gibt zurück

Ein Array von DesignerGlyph-Objekten, die für den Aktivitätsdesigner gerendert werden sollen.

Beispiele

In folgendem Codebeispiel wird die Implementierung der GetGlyphs-Methode zum Zeichnen von benutzerdefinierten Symbolobjekten auf einer Aktivitätsdesigneroberfläche erläutert.

Dieses Codebeispiel ist ein Teil des Workflow Monitor SDK-Beispiels der Datei DesignerGlyphProvider.cs. Weitere Informationen finden Sie unter Workflowmonitor.

//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

Gilt für:

Weitere Informationen