Sdílet prostřednictvím


IDesignerGlyphProvider Rozhraní

Definice

Upozornění

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

Definuje metodu, které třídy zprostředkovatele glyfů používají k vygenerování pole glyfů k zobrazení v návrháři aktivity.

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
Atributy

Příklady

Následující příklad kódu ukazuje, jak můžete implementovat IDesignerGlyphProvider rozhraní. Ukazuje, jak můžete implementovat metodu GetGlyphs pro kreslení vlastních objektů piktogramů na ploše návrháře aktivity.

Tento příklad kódu je součástí ukázky sady SDK pro monitorování pracovních postupů ze souboru DesignerGlyphProvider.cs. Další informace najdete v tématu Monitorování pracovního postupu.

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

Poznámky

Poznámka

V tomto materiálu jsou popsané zastaralé typy a obory názvů. Další informace naleznete v tématu Zastaralé typy ve Windows Workflow Foundation 4.5.

Toto rozhraní definuje metodu, která implementuje třídy musí použít k poskytnutí odpovídající sady DesignerGlyph objektů návrhářům aktivit. Implementovací třída by také měla vykreslit DesignerGlyph objekty na ActivityDesigner objekt.

Metody

GetGlyphs(ActivityDesigner)
Zastaralé.

Vrátí pole piktogramů, které jsou přidruženy k zadanému návrháři aktivity.

Platí pro

Viz také