
Visual Basic (Declaration) | |
---|---|
Public Class ActivityCollection Inherits SourceCode.Workflow.Authoring.K2ObjectCollection(Of Process,Activity) Implements SourceCode.Framework.IPersistableList |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As ActivityCollection |
C# | |
---|---|
public class ActivityCollection : SourceCode.Workflow.Authoring.K2ObjectCollection<Process,Activity>, SourceCode.Framework.IPersistableList |
C++/CLI | |
---|---|
public ref class ActivityCollection : public SourceCode.Workflow.Authoring.K2ObjectCollection<Process,Activity>, SourceCode.Framework.IPersistableList |
The following example uses a "For each" statement to determine if a particular
Activity is available in the collection. If the Activity is found, the RemoveAt method
is used to remove the particular Activity from the collection. The Add method is used
to add an Activity to the collection.
Visual Basic | ![]() |
---|---|
Public Function AddActivity(ByVal thisAct As Activity, ByVal myActCollection As ActivityCollection) Dim tempAct As Activity 'remove if activity exist in collection For Each tempAct In myActCollection If tempAct.Name = thisAct.Name Then yActCollection.Remove(tempAct) Exit For End If Next 'add activity to collection Dim tempID As Integer = tempID = myActCollection.Add(thisAct) 'return id of newly added activity Return tempID End Function |
System.Object
System.Collections.CollectionBase
SourceCode.Framework.PersistableObjectCollectionBase<TParent,TItem>
SourceCode.Workflow.Authoring.K2ObjectCollection<TParent,TItem>
SourceCode.Workflow.Authoring.ActivityCollection
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2