WorkflowView.RootDesigner Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the root designer for the 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
Property Value
The ActivityDesigner associated with the WorkflowView.
Examples
The following example shows how to retrieve the RootDesigner of a WorkflowView object. The workflowPanel field contains a method named GetWorkflowView that returns the active WorkflowView instance. The RootDesigner is then cast to a SequentialWorkflowRootDesigner before any action is taken on it.
This code example is part of the Basic DesignerHosting SDK Sample from the DesignerShell.cs file. For more information, see Basic Designer Hosting Sample.
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
Remarks
The root designer of the workflow is the designer associated with the design surface of the workflow. It contains all child designers, and subsequently all activities in the workflow.
Applies to
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ