ActivityDesigner.Verbs Property

Definition

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

C#
protected virtual System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection Verbs { get; }

Property Value

The collection of verbs to be associated with the designer.

Examples

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.

C#
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
}

Remarks

Use the Verbs method to determine the verbs to show on the Context Menu.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1