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에 추가할 ICollection입니다.The 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. 이 코드 예제는 ThrowWorkflow.cs 파일에 있는 Throw SDK 샘플의 일부입니다.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

적용 대상