ActivityDesigner.Verbs Propiedad

Definición

Obtiene la colección de verbos para asociar al diseñador.Gets the collection of verbs to be associated with the designer.

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

Valor de propiedad

Colección de verbos para asociar al diseñador.The collection of verbs to be associated with the designer.

Ejemplos

El ejemplo siguiente muestra cómo invalidar la propiedad Verbs para insertar las acciones de verbo personalizadas para ActivityPreviewDesigner.The following example demonstrates how to override the Verbs property to insert custom verb actions for a ActivityPreviewDesigner. CreateActivityVerbs crea un nuevo ActivityDesignerVerb denominado "Add New Parallel Branch" y asocia un controlador de eventos denominado OnAddParallelBranch.The CreateActivityVerbs creates a new ActivityDesignerVerb named "Add New Parallel Branch" and associates an event handler named OnAddParallelBranch. Cuando se hace clic en el verbo en el Workflow Designer, se llama al controlador de eventos.When the verb is clicked in the workflow designer, the event handler is called.

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

Comentarios

Utilice el método de verbos para determinar los verbos para mostrar en el menú contextual.Use the Verbs method to determine the verbs to show on the Context Menu.

Se aplica a