Mono Class Library: System.Collections.ArrayList Overview | Members

System.Collections.ArrayList.Adapter Method

Creates a ArrayList that is a wrapper for the specified IList.

public static ArrayList Adapter (IList list)

Parameters

list
The IList to wrap.

Returns

The ArrayList wrapper for list.

Exceptions

TypeReason
ArgumentNullExceptionlist is null.

Remarks

This method returns a ArrayList that contains a reference to the IListlist . Any modifications to the elements in either the returned list or list are reflected in the other.

Note: The ArrayList class provides generic ArrayList.Reverse, ArrayList.BinarySearch(int, int, object, IComparer) and ArrayList.Sort methods. This wrapper provides a means to use those methods on IListlist without implementing the methods for the list. Performing these operations through the wrapper might be less efficient than operations applied directly to the list.

Requirements

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