Export (0) Print
Expand All

ActivityCollection.Add Method

Adds the Activity to the ICollection.

Namespace:  System.Workflow.ComponentModel
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

'Declaration
Public Sub Add ( _
	item As Activity _
)

Parameters

item
Type: System.Workflow.ComponentModel.Activity

The Activity to be added to the ICollection.

The following example shows access of the ActivityCollection which is the member of a composite activity class containing all child activities. This example illustrates the use of Add. This code example is part of the Throw SDK sample and is from the ThrowWorkflow.cs file. For more information, see Using the ThrowActivity Activity.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0
Show:
© 2015 Microsoft