ActivityCollection Class
Members Example See Also 
SourceCode.Workflow.Authoring Namespace : ActivityCollection Class



Glossary Item Box

Returns a collection of Activity objects.

Object Model

ActivityCollection ClassActivity Class

Syntax

Visual Basic (Declaration) 
Public Class ActivityCollection 
   Inherits SourceCode.Workflow.Authoring.K2ObjectCollection(Of Process,Activity)
   Implements SourceCode.Framework.IPersistableList 
Visual Basic (Usage)Copy Code
Dim instance As ActivityCollection

Example

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 BasicCopy Code
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

Inheritance Hierarchy

Requirements

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

See Also