Mono Class Library: System.Collections.Specialized.NameValueCollection Overview | Members

System.Collections.Specialized.NameValueCollection.CopyTo Method

Copies the elements from the current instance to the specified Array, starting at the specified index in that array. [Edit]

public void CopyTo (Array dest, int index)

Parameters

dest
A one-dimensional, zero-based Array that is the destination of the elements copied from the current instance. [Edit]
index
A int containing the zero-based index in dest at which copying begins. [Edit]

Exceptions

TypeReason
ArgumentNullExceptiondest is null. [Edit]
ArgumentOutOfRangeExceptionindex < 0. [Edit]
ArgumentException

dest has more than one dimension.

-or-

index >= dest.Length.

-or-

The number of elements in the current instance is greater than the available space from index to the end of the destination dest.

[Edit]
InvalidCastExceptionAt least one element in the current instance is not assignment-compatible with the type of dest. [Edit]

Remarks

This method uses Array.Copy(Array, Array, int) to copy the elements.

Note: This method is implemented to support the ICollection interface.

[Edit]

Requirements

Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0