ActivityCollection Class

Definition

Warning

This API is now obsolete.

Models a strongly typed ICollection of type Activity.

public ref class ActivityCollection sealed : System::Collections::Generic::List<System::Workflow::ComponentModel::Activity ^>, System::Collections::Generic::ICollection<System::Workflow::ComponentModel::Activity ^>, System::Collections::Generic::IEnumerable<System::Workflow::ComponentModel::Activity ^>, System::Collections::Generic::IList<System::Workflow::ComponentModel::Activity ^>
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public sealed class ActivityCollection : System.Collections.Generic.List<System.Workflow.ComponentModel.Activity>, System.Collections.Generic.ICollection<System.Workflow.ComponentModel.Activity>, System.Collections.Generic.IEnumerable<System.Workflow.ComponentModel.Activity>, System.Collections.Generic.IList<System.Workflow.ComponentModel.Activity>
type ActivityCollection = class
    inherit List<Activity>
    interface IList<Activity>
    interface ICollection<Activity>
    interface seq<Activity>
    interface IEnumerable
    interface IList
    interface ICollection
Public NotInheritable Class ActivityCollection
Inherits List(Of Activity)
Implements ICollection(Of Activity), IEnumerable(Of Activity), IList(Of Activity)
Inheritance
ActivityCollection
Attributes
Implements

Examples

The following example shows access of the ActivityCollection which is the member of a composite activity class containing all child activities. This code example is part of the Using Throw SDK Sample and is from the ThrowWorkflow.cs file. 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

Remarks

Note

This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

This class is used to represent the list of child activities for a CompositeActivity.

Note

Only call methods derived from IList<T> and not List<T>, such as using Add to add activities instead of AddRange. Calling methods derived from List<T> will have unexpected consequences.

Constructors

ActivityCollection(Activity)

Initializes a new instance of the ActivityCollection class, initializing an owner Activity.

Properties

Capacity

Gets or sets the total number of elements the internal data structure can hold without resizing.

(Inherited from List<T>)
Count

Gets the number of members of the ICollection.

Item[Int32]

Gets or sets the activity in the ICollection based on the index.

Item[String]

Gets the activity in the ICollection based on the string which is a unique key.

Methods

Add(Activity)

Adds the Activity to the ICollection.

Add(T)

Adds an object to the end of the List<T>.

(Inherited from List<T>)
AddRange(IEnumerable<T>)

Adds the elements of the specified collection to the end of the List<T>.

(Inherited from List<T>)
AsReadOnly()

Returns a read-only ReadOnlyCollection<T> wrapper for the current collection.

(Inherited from List<T>)
BinarySearch(Int32, Int32, T, IComparer<T>)

Searches a range of elements in the sorted List<T> for an element using the specified comparer and returns the zero-based index of the element.

(Inherited from List<T>)
BinarySearch(T)

Searches the entire sorted List<T> for an element using the default comparer and returns the zero-based index of the element.

(Inherited from List<T>)
BinarySearch(T, IComparer<T>)

Searches the entire sorted List<T> for an element using the specified comparer and returns the zero-based index of the element.

(Inherited from List<T>)
Clear()

Removes every Activity from the ICollection.

Contains(Activity)

Provides a test for membership of the Activity in the ICollection.

Contains(T)

Determines whether an element is in the List<T>.

(Inherited from List<T>)
ConvertAll<TOutput>(Converter<T,TOutput>)

Converts the elements in the current List<T> to another type, and returns a list containing the converted elements.

(Inherited from List<T>)
CopyTo(Int32, T[], Int32, Int32)

Copies a range of elements from the List<T> to a compatible one-dimensional array, starting at the specified index of the target array.

(Inherited from List<T>)
CopyTo(T[])

Copies the entire List<T> to a compatible one-dimensional array, starting at the beginning of the target array.

(Inherited from List<T>)
CopyTo(T[], Int32)

Copies the entire List<T> to a compatible one-dimensional array, starting at the specified index of the target array.

(Inherited from List<T>)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Exists(Predicate<T>)

Determines whether the List<T> contains elements that match the conditions defined by the specified predicate.

(Inherited from List<T>)
Find(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire List<T>.

(Inherited from List<T>)
FindAll(Predicate<T>)

Retrieves all the elements that match the conditions defined by the specified predicate.

(Inherited from List<T>)
FindIndex(Int32, Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the List<T> that starts at the specified index and contains the specified number of elements.

(Inherited from List<T>)
FindIndex(Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the List<T> that extends from the specified index to the last element.

(Inherited from List<T>)
FindIndex(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire List<T>.

(Inherited from List<T>)
FindLast(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire List<T>.

(Inherited from List<T>)
FindLastIndex(Int32, Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the List<T> that contains the specified number of elements and ends at the specified index.

(Inherited from List<T>)
FindLastIndex(Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the List<T> that extends from the first element to the specified index.

(Inherited from List<T>)
FindLastIndex(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire List<T>.

(Inherited from List<T>)
ForEach(Action<T>)

Performs the specified action on each element of the List<T>.

(Inherited from List<T>)
GetEnumerator()

Implements an enumeration interface to the ICollection.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRange(Int32, Int32)

Creates a shallow copy of a range of elements in the source List<T>.

(Inherited from List<T>)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IndexOf(Activity)

Gets the index of the Activity in the ICollection.

IndexOf(T)

Searches for the specified object and returns the zero-based index of the first occurrence within the entire List<T>.

(Inherited from List<T>)
IndexOf(T, Int32)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the List<T> that extends from the specified index to the last element.

(Inherited from List<T>)
IndexOf(T, Int32, Int32)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the List<T> that starts at the specified index and contains the specified number of elements.

(Inherited from List<T>)
Insert(Int32, Activity)

Inserts the item at the index in the ICollection.

Insert(Int32, T)

Inserts an element into the List<T> at the specified index.

(Inherited from List<T>)
InsertRange(Int32, IEnumerable<T>)

Inserts the elements of a collection into the List<T> at the specified index.

(Inherited from List<T>)
LastIndexOf(T)

Searches for the specified object and returns the zero-based index of the last occurrence within the entire List<T>.

(Inherited from List<T>)
LastIndexOf(T, Int32)

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the List<T> that extends from the first element to the specified index.

(Inherited from List<T>)
LastIndexOf(T, Int32, Int32)

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the List<T> that contains the specified number of elements and ends at the specified index.

(Inherited from List<T>)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(Activity)

Removes the activity specified in the call from the ICollection.

Remove(T)

Removes the first occurrence of a specific object from the List<T>.

(Inherited from List<T>)
RemoveAll(Predicate<T>)

Removes all the elements that match the conditions defined by the specified predicate.

(Inherited from List<T>)
RemoveAt(Int32)

Removes the Activity in the ICollection at the specified index.

RemoveRange(Int32, Int32)

Removes a range of elements from the List<T>.

(Inherited from List<T>)
Reverse()

Reverses the order of the elements in the entire List<T>.

(Inherited from List<T>)
Reverse(Int32, Int32)

Reverses the order of the elements in the specified range.

(Inherited from List<T>)
Sort()

Sorts the elements in the entire List<T> using the default comparer.

(Inherited from List<T>)
Sort(Comparison<T>)

Sorts the elements in the entire List<T> using the specified Comparison<T>.

(Inherited from List<T>)
Sort(IComparer<T>)

Sorts the elements in the entire List<T> using the specified comparer.

(Inherited from List<T>)
Sort(Int32, Int32, IComparer<T>)

Sorts the elements in a range of elements in List<T> using the specified comparer.

(Inherited from List<T>)
ToArray()

Copies the elements of the List<T> to a new array.

(Inherited from List<T>)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrimExcess()

Sets the capacity to the actual number of elements in the List<T>, if that number is less than a threshold value.

(Inherited from List<T>)
TrueForAll(Predicate<T>)

Determines whether every element in the List<T> matches the conditions defined by the specified predicate.

(Inherited from List<T>)

Events

ListChanged

Raised whenever a change is made to the contents of this ICollection.

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32)

Copies the elements of the ICollection to an Array, starting at a particular Array index.

ICollection.IsSynchronized

Gets a value that indicates whether access to the ICollection<T> is synchronized, that is thread-safe.

ICollection.SyncRoot

Gets an object that can be used to synchronize access to the ICollection<T>.

ICollection<Activity>.Add(Activity)

Adds an object to the IList at the end of the IList.

ICollection<Activity>.Clear()

Clears all activities from the IList.

ICollection<Activity>.Contains(Activity)

Gets a value that indicates whether the Object is a member of the collection.

ICollection<Activity>.CopyTo(Activity[], Int32)

Copies the elements of the ICollection to an Array, starting at a particular Array index.

ICollection<Activity>.Count

Gets the number of elements contained in the ICollection<T>.

ICollection<Activity>.IsReadOnly

Gets a value that indicates whether the IList is read-only.

ICollection<Activity>.Remove(Activity)

Removes the first occurrence of a specific object from the ICollection<T>.

ICollection<T>.IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

(Inherited from List<T>)
IEnumerable.GetEnumerator()

Returns an IEnumerator that iterates through the underlying IList.

IEnumerable<Activity>.GetEnumerator()

Returns an enumerator that iterates through the collection.

IEnumerable<T>.GetEnumerator()

Returns an enumerator that iterates through a collection.

(Inherited from List<T>)
IList.Add(Object)

Adds an object to the IList at the end of the IList.

IList.Clear()

Removes all Activity from the ICollection.

IList.Contains(Object)

Gets a value that indicates whether the Object is a member of the collection.

IList.IndexOf(Object)

Gets the zero-based index of the Object in the underlying activities collection.

IList.Insert(Int32, Object)

Inserts an Object into the IList at the zero-based index specified.

IList.IsFixedSize

Gets a value indicating whether the IList has a fixed size.

IList.IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

IList.Item[Int32]

Gets or sets the activity in the ICollection based on the index.

IList.Remove(Object)

Removes the first occurrence of a specific object from the IList.

IList<Activity>.IndexOf(Activity)

Determines the index of a specific item in the IList.

IList<Activity>.Insert(Int32, Activity)

Inserts an Object into the IList at the zero-based index specified.

IList<Activity>.Item[Int32]

Gets or sets the element at the specified index.

IList<Activity>.RemoveAt(Int32)

Removes the IList item at the specified index.

Extension Methods

CopyToDataTable<T>(IEnumerable<T>)

Returns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to