IDesignerGlyphProvider Interface

Définition

Attention

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

Définit la méthode que les classes de fournisseur de glyphes utilisent pour générer un tableau de glyphes à afficher sur un concepteur d'activités.

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
Attributs

Exemples

L'exemple de code suivant montre comment implémenter l'interface IDesignerGlyphProvider. Il montre comment implémenter la méthode GetGlyphs pour dessiner des objets de glyphe personnalisés sur une aire du concepteur d'activités.

Cet exemple de code fait partie de l'exemple du Kit de développement logiciel Workflow Monitor (SDK) et provient du fichier DesignerGlyphProvider.cs. Pour plus d’informations, consultez Workflow Monitor.

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

Remarques

Notes

Ce document décrit les types et les espaces de noms qui sont obsolètes. Pour plus d’informations, consultez Types dépréciés dans Windows Workflow Foundation 4.5.

Cette interface définit la méthode que les classes d'implémentation doivent utiliser pour fournir un ensemble approprié d'objets DesignerGlyph aux concepteurs d'activités. La classe d'implémentation doit également restituer les objets DesignerGlyph sur l'objet ActivityDesigner.

Méthodes

GetGlyphs(ActivityDesigner)
Obsolète.

Retourne un tableau de glyphes associés au concepteur d'activités spécifié.

S’applique à

Voir aussi