WorkflowView.RootDesigner Proprietà

Definizione

Ottiene o imposta RootDesigner per la classe WorkflowView.

public:
 property System::Workflow::ComponentModel::Design::ActivityDesigner ^ RootDesigner { System::Workflow::ComponentModel::Design::ActivityDesigner ^ get(); void set(System::Workflow::ComponentModel::Design::ActivityDesigner ^ value); };
public System.Workflow.ComponentModel.Design.ActivityDesigner RootDesigner { get; set; }
member this.RootDesigner : System.Workflow.ComponentModel.Design.ActivityDesigner with get, set
Public Property RootDesigner As ActivityDesigner

Valore della proprietà

ActivityDesigner

Oggetto ActivityDesigner associato all'oggetto WorkflowView.

Esempio

Nell'esempio seguente viene illustrato come recuperare RootDesigner di un oggetto WorkflowView. Il campo workflowPanel contiene un metodo denominato GetWorkflowView che restituisce l'istanza attiva di WorkflowView. Viene quindi eseguito il cast di RootDesigner su un SequentialWorkflowRootDesigner prima che venga intrapresa qualsiasi azione.

Questo esempio di codice è parte dell'esempio SDK Basic DesignerHosting nel file DesignerShell.cs. Per altre informazioni, vedere Esempio di hosting della finestra di progettazione di base.

private void addButton_Click(object sender, EventArgs e)
{
    SequentialWorkflowRootDesigner rootDesigner = this.workflowPanel.GetWorkflowView().RootDesigner as SequentialWorkflowRootDesigner;
    int viewId = rootDesigner.ActiveView.ViewId;
    if (viewId == 1)
    {
        this.workflowPanel.OnCodeActivityAdded();
    }
    else
    {
        DialogResult resultBox = MessageBox.Show("This sample supports adding a code activity only in workflow view");
    }
}
Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
    Dim viewId As Integer
    Dim rootDesigner As SequentialWorkflowRootDesigner
    rootDesigner = Me.workflowPanel.GetWorkflowView().RootDesigner
    viewId = rootDesigner.ActiveView.ViewId
    If viewId = 1 Then
        Me.workflowPanel.OnCodeActivityAdded()
    Else
        Dim resultBox As DialogResult
        resultBox = MessageBox.Show("This sample supports adding a code activity only in workflow view")
    End If
End Sub

Commenti

RootDesigner del flusso di lavoro è la finestra di progettazione associata all'area di progettazione del flusso di lavoro. Contiene tutte le finestre di progettazione figlio e successivamente tutte le attività del flusso di lavoro.

Si applica a