ActivityCollection.Add(Activity) メソッド

定義

ActivityICollection に追加します。Adds the Activity to the ICollection.

public:
 void Add(System::Workflow::ComponentModel::Activity ^ item);
public void Add (System.Workflow.ComponentModel.Activity item);
override this.Add : System.Workflow.ComponentModel.Activity -> unit
Public Sub Add (item As Activity)

パラメーター

item
Activity

Activity に追加される ICollectionThe Activity to be added to the ICollection.

実装

次の例では、すべての子アクティビティを含む複合アクティビティ クラスのメンバーである ActivityCollection にアクセスしています。The following example shows access of the ActivityCollection which is the member of a composite activity class containing all child activities. この例では、Add の使用法を示します。This example illustrates the use of Add. このコード例は Throw SDK サンプルの一部で、ThrowWorkflow.cs ファイルから抽出したものです。This code example is part of the Throw SDK sample and is from the ThrowWorkflow.cs file. 詳細については、「 ThrowActivity アクティビティの使用」を参照してください。For more information, see Using the ThrowActivity Activity.

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

適用対象