NAnt SDK Documentation - v0.92 |

# TargetCollection Methods

The methods of the TargetCollection class are listed below. For a complete list of TargetCollection class members, see the TargetCollection Members topic.

#### Public Instance Methods

Add | Overloaded.
AddRange (inherited from ArrayList) | Adds the elements of an ICollection to the end of the ArrayList.
BinarySearch (inherited from ArrayList) | Overloaded. Searches a range of elements in the sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.
Clear (inherited from ArrayList) | Removes all elements from the ArrayList.
Clone (inherited from ArrayList) | Creates a shallow copy of the ArrayList.
Contains (inherited from ArrayList) | Determines whether an element is in the ArrayList.
CopyTo (inherited from ArrayList) | Overloaded. Copies the entire ArrayList to a compatible one-dimensional Array, starting at the beginning of the target array.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Find | Finds a target by name.
GetEnumerator (inherited from ArrayList) | Overloaded. Returns an enumerator for the entire ArrayList.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetRange (inherited from ArrayList) | Returns an ArrayList which represents a subset of the elements in the source ArrayList.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf (inherited from ArrayList) | Overloaded. Searches for the specified Object and returns the zero-based index of the first occurrence within the entire ArrayList.
Insert (inherited from ArrayList) | Inserts an element into the ArrayList at the specified index.
InsertRange (inherited from ArrayList) | Inserts the elements of a collection into the ArrayList at the specified index.
LastIndexOf (inherited from ArrayList) | Overloaded. Searches for the specified Object and returns the zero-based index of the last occurrence within the entire ArrayList.
Remove (inherited from ArrayList) | Removes the first occurrence of a specific object from the ArrayList.
RemoveAt (inherited from ArrayList) | Removes the element at the specified index of the ArrayList.
RemoveRange (inherited from ArrayList) | Removes a range of elements from the ArrayList.
Reverse (inherited from ArrayList) | Overloaded. Reverses the order of the elements in the entire ArrayList.
SetRange (inherited from ArrayList) | Copies the elements of a collection over a range of elements in the ArrayList.
Sort (inherited from ArrayList) | Overloaded. Sorts the elements in the entire ArrayList using the IComparable implementation of each element.
ToArray (inherited from ArrayList) | Overloaded. Copies the elements of the ArrayList to a new Object array.
ToString | Overloaded. Gets the names of the targets in the TargetCollection combined into one list separated by the given String.
TrimToSize (inherited from ArrayList) | Sets the capacity to the actual number of elements in the ArrayList.

#### Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

#### See Also

TargetCollection Class | NAnt.Core Namespace