Compartilhar via


ParallelActivityDesigner.Verbs Propriedade

Definição

Obtém a coleção de verbos do designer a serem associados ao ParallelActivityDesigner.

protected:
 virtual property System::Workflow::ComponentModel::Design::ActivityDesignerVerbCollection ^ Verbs { System::Workflow::ComponentModel::Design::ActivityDesignerVerbCollection ^ get(); };
protected override System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection Verbs { get; }
member this.Verbs : System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection
Protected Overrides ReadOnly Property Verbs As ActivityDesignerVerbCollection

Valor da propriedade

ActivityDesignerVerbCollection

Um ActivityDesignerVerbCollection que contém os verbos do designer a serem associados ao ParallelActivityDesigner.

Exemplos

O exemplo a seguir demonstra como substituir a Verbs propriedade para inserir ações de verbo personalizadas para um ActivityPreviewDesigner. Ele CreateActivityVerbs cria um novo ActivityDesignerVerb nome "Add New Parallel Branch" e associa um manipulador de eventos chamado OnAddParallelBranch. Quando o verbo é clicado no designer de fluxo de trabalho, o manipulador de eventos é chamado.

private ActivityDesignerVerbCollection verbs = null;

protected override ActivityDesignerVerbCollection Verbs
{
    get
    {
        if (this.verbs == null)
            CreateActivityVerbs();

        return this.verbs;
    }
}

private void CreateActivityVerbs()
{
    this.verbs = new ActivityDesignerVerbCollection();

    ActivityDesignerVerb addBranchVerb = new ActivityDesignerVerb(this,
        DesignerVerbGroup.View, "Add New Parallel Branch", new EventHandler(OnAddParallelBranch));
    this.verbs.Clear();

    this.verbs.Add(addBranchVerb);
}

protected void OnAddParallelBranch(object sender, EventArgs e)
{
    // Code for adding a new branch to the parallel activity goes here
}
Private verbsValue As ActivityDesignerVerbCollection = Nothing

Protected Overrides ReadOnly Property Verbs() As ActivityDesignerVerbCollection
    Get
        If verbsValue Is Nothing Then
            CreateActivityVerbs()
        End If
        Return Me.verbsValue

    End Get
End Property

Private Sub CreateActivityVerbs()
    Me.verbsValue = New ActivityDesignerVerbCollection()

    Dim addBranchVerb As New ActivityDesignerVerb(Me, DesignerVerbGroup.View, "Add New Parallel Branch", AddressOf OnAddParallelBranch)

    Me.verbsValue.Clear()

    Me.verbsValue.Add(addBranchVerb)
End Sub

Protected Sub OnAddParallelBranch(ByVal sender As Object, ByVal e As EventArgs)
    ' Code for adding a new branch to the parallel activity goes here
End Sub

Comentários

A Verbs propriedade determina os comandos exibidos no menu de ParallelActivityDesigner contexto.

A coleção de verbos inclui quaisquer verbos ParallelActivityDesigner de designer herdados das classes de designer que ela estende.

Aplica-se a