NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ArrayList.CopyTo (Int32, Array, Int32, Int32)

Copies a range of elements from the ArrayList into a compatible one-dimensional Array, starting at the specified index of the target array.

[Visual Basic]
Overloads Overridable Public Sub CopyTo( _
   ByVal index As Integer, _
   ByVal array As Array, _
   ByVal arrayIndex As Integer, _
   ByVal count As Integer _
)
[C#]
public virtual void CopyTo(
   int index,
   Array array,
   int arrayIndex,
   int count
);
[C++]
public: virtual void CopyTo(
   int index,
   Array* array,
   int arrayIndex,
   int count
);
[JScript]
public function CopyTo(
   index : int,
   array : Array,
   arrayIndex : int,
   count : int
);

Parameters

index
The ArrayList index to start copying from.
array
The one-dimensional Array to copy the elements into.
arrayIndex
The array index to start copying into.
count
The number of elements to copy.

Return Value

None.

Exceptions

Exception Type Condition
ArgumentException array is multidimensional.

-or-

count is greater than the available space between arrayIndex and the end of array.

ArgumentNullException array is a null reference (in Visual Basic Nothing).
ArgumentOutOfRangeException index and count do not specify a valid range in the ArrayList.

-or-

count is greater than the number of items from index to the end of ArrayList.

-or- arrayIndex is less than array 's lowbound.

Remarks

This method can be overridden by a derived class.

array must be of a compatible array type.

See Also

ArrayList Class | ArrayList Members | System.Collections Namespace | ArrayList.CopyTo Overload List