Mono Class Library: System.Collections.Generic.ICollection<T> Overview | Members

System.Collections.Generic.ICollection<T>.CopyTo Method

Copies the elements of the current collection to a Array, starting at the specified index.

public void CopyTo (T[] array, int arrayIndex)

Parameters

array
A one-dimensional, zero-based Array that is the destination of the elements copied from the current instance.
arrayIndex
Documentation for this section has not yet been entered.

Exceptions

TypeReason
ArgumentNullExceptionarray is null.
ArgumentOutOfRangeExceptionindex < 0.
ArgumentException

array has more than one dimension.

-or-

index is greater than or equal to array.Length.

-or-

The sum of index and the ICollection.Count of the current instance is greater than array.Length.

-or-

Type T is not assignable to the element type of the destination array.

Remarks

This operation overwrites the current contents of the array.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0