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.ToArray (Type)

Copies the elements of the ArrayList to a new array of the specified type.

[Visual Basic]
Overloads Overridable Public Function ToArray( _
   ByVal type As Type _
) As Array
[C#]
public virtual Array ToArray(
   Type type
);
[C++]
public: virtual Array* ToArray(
   Type* type
);
[JScript]
public function ToArray(
   type : Type
) : Array;

Parameters

type
The type of array to create and copy elements to.

Return Value

An array of the specified type containing copies of the elements of the ArrayList.

Exceptions

Exception Type Condition
ArgumentNullException type is a null reference (in Visual Basic Nothing).

Remarks

This method can be overridden by a derived class.

The elements are copied using Copy, which is an O(n) operation.Elements may be downcasted as required. The copy operation may fail if the downcasting is not allowed.

See Also

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