Foley .NET Utilities Class Library

LinkedList.CopyTo Method 

Copies the entire LinkedList to a compatible one-dimensional Array, starting at the specified index of the target array.

[Visual Basic]
Overrides Public Sub CopyTo( _
   ByVal array As Array, _
   ByVal index As Integer _
) Implements _
   ICollection.CopyTo
[C#]
public override void CopyTo(
   Array array,
   int index
);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from the LinkedList. The Array must have zero-based indexing.
index
The zero-based index in array at which copying begins.

Implements

ICollection.CopyTo

Exceptions

Exception TypeCondition
System.ArgumentNullException The array is a null reference (Nothing in Visual Basic).
System.ArgumentOutOfRangeException The index is less than zero.
System.ArgumentException The array is multidimensional.

-or-

The index is equal to or greater than the length of array.

-or-


The number of elements in the LinkedList is greater than the available space from index to the end of the destination array.

See Also

LinkedList Class | LinkedList Members | Foley.Utilities.Collections Namespace