IDesignerGlyphProvider Interfejs

Definicja

Przestroga

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

Definiuje metodę używaną przez klasy dostawcy glyph do generowania tablicy glifów do wyświetlania w projektancie działań.

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
Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak można zaimplementować IDesignerGlyphProvider interfejs. Pokazano w nim, jak można zaimplementować metodę GetGlyphs w celu rysowania niestandardowych obiektów glifów na powierzchni projektanta działań.

Ten przykład kodu jest częścią przykładowego zestawu SDK monitora przepływu pracy z pliku DesignerGlyphProvider.cs. Aby uzyskać więcej informacji, zobacz Monitor przepływu pracy.

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

Uwagi

Uwaga

W tym materiale omówiono przestarzałe typy i przestrzenie nazw. Aby uzyskać więcej informacji, zobacz Przestarzałe typy w programie Windows Workflow Foundation 4.5.

Ten interfejs definiuje metodę, która implementuje klasy muszą używać w celu zapewnienia odpowiedniego DesignerGlyph zestawu obiektów projektantom działań. Klasa implementowania powinna również renderować DesignerGlyph obiekty na ActivityDesigner obiekcie.

Metody

GetGlyphs(ActivityDesigner)
Przestarzałe.

Zwraca tablicę glifów skojarzonych z określonym projektantem działań.

Dotyczy

Zobacz też