ActivityCollection.Add(Activity) Método

Definición

Agrega Activity a 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)

Parámetros

item
Activity

Activity que se va a agregar a ICollection.

Implementaciones

Ejemplos

El ejemplo siguiente muestra el acceso de ActivityCollection que es el miembro de una clase de actividad compuesta que contiene todas las actividades secundarias. Este ejemplo también muestra el uso de Add. Este ejemplo de código es parte de la muestra de SDK Iniciar y pertenece al archivo ThrowWorkflow.cs. Para obtener más información, consulte Uso de la actividad ThrowActivity.

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

Se aplica a