共用方式為


CompositeActivity.Activities 屬性

定義

取得物件,這個物件代表所有子活動的集合 ActivityCollection

public:
 property System::Workflow::ComponentModel::ActivityCollection ^ Activities { System::Workflow::ComponentModel::ActivityCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Workflow.ComponentModel.ActivityCollection Activities { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Activities : System.Workflow.ComponentModel.ActivityCollection
Public ReadOnly Property Activities As ActivityCollection

屬性值

ActivityCollection

所有子活動的 ActivityCollection

屬性

範例

下列程式碼將示範如何建立活動,並將活動當做子系加入至複合活動,同時包含為這個型別設定 CanModifyActivities 寬鬆。

這個程式碼範例是 ThrowWorkflow.cs 檔案中<擲回 SDK>範例的一部分。 如需詳細資訊,請參閱 擲回範例

this.CanModifyActivities = true;
System.Workflow.ComponentModel.ActivityBind activitybind1 = new System.Workflow.ComponentModel.ActivityBind();
this.throwActivity1 = new System.Workflow.ComponentModel.ThrowActivity();
activitybind1.Name = "ThrowWorkflow";
activitybind1.Path = "ThrownException";
//
// throwActivity1
//
this.throwActivity1.Name = "throwActivity1";
this.throwActivity1.SetBinding(System.Workflow.ComponentModel.ThrowActivity.FaultProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
//
// ThrowWorkflow
//
this.Activities.Add(this.throwActivity1);
this.Name = "ThrowWorkflow";
this.CanModifyActivities = false;
Me.CanModifyActivities = True
Dim activitybind1 As New System.Workflow.ComponentModel.ActivityBind()
Me.throwActivity1 = New System.Workflow.ComponentModel.ThrowActivity()
activitybind1.Name = "ThrowWorkflow"
activitybind1.Path = "ThrownException"
' 
' throwActivity1
' 
Me.throwActivity1.Name = "throwActivity1"
Me.throwActivity1.SetBinding(System.Workflow.ComponentModel.ThrowActivity.FaultProperty, activitybind1)
' 
' ThrowWorkflow
' 
Me.Activities.Add(Me.throwActivity1)
Me.Name = "ThrowWorkflow"
Me.CanModifyActivities = False

備註

代表由複合活動管理的子活動集合。 這個集合可更新。

適用於