다음을 통해 공유


ActivityDesigner.Verbs 속성

정의

디자이너와 연결할 동사 컬렉션을 가져옵니다.

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

속성 값

ActivityDesignerVerbCollection

디자이너와 연결할 동사의 컬렉션입니다.

예제

다음 예제에서는 Verbs의 사용자 지정 동사 작업을 삽입하기 위해 ActivityPreviewDesigner 속성을 재정의하는 방법을 보여 줍니다. CreateActivityVerbsActivityDesignerVerb라는 새 "Add New Parallel Branch"를 만들고 OnAddParallelBranch라는 이벤트 처리기를 연결합니다. 워크플로 디자이너에서 동사를 클릭하면 이벤트 처리기가 호출됩니다.

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

설명

상황에 맞는 메뉴에 표시할 동사를 결정하려면 Verbs 메서드를 사용합니다.

적용 대상