ParallelActivityDesigner.Verbs Property

 

Gets the collection of designer verbs to be associated with the ParallelActivityDesigner.

Namespace:   System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

protected override ActivityDesignerVerbCollection Verbs { get; }

Property Value

Type: System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection

An ActivityDesignerVerbCollection that contains the designer verbs to associate with the ParallelActivityDesigner.

The Verbs property determines the commands that are displayed on the ParallelActivityDesigner context menu.

The verb collection includes any designer verbs ParallelActivityDesigner inherits from the designer classes it extends.

The following example demonstrates how to override the Verbs property to insert custom verb actions for a ActivityPreviewDesigner. The CreateActivityVerbs creates a new ActivityDesignerVerb named "Add New Parallel Branch" and associates an event handler named OnAddParallelBranch. 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
}

.NET Framework
Available since 3.0
Return to top
Show: