Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ArrayList.Adapter Method

Creates an ArrayList wrapper for a specific IList.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)

public static ArrayList Adapter (
	IList list
)
public static ArrayList Adapter (
	IList list
)
public static function Adapter (
	list : IList
) : ArrayList
Not applicable.

Parameters

list

The IList to wrap.

Return Value

The ArrayList wrapper around the IList.

Exception typeCondition

ArgumentNullException

list is a null reference (Nothing in Visual Basic).

Adapter does not copy the contents of IList. Instead, it only creates an ArrayList wrapper around IList; therefore, changes to the IList also affect the ArrayList.

The ArrayList class provides generic Reverse, BinarySearch and Sort methods. This wrapper can be a means to use those methods on IList; however, performing these generic operations through the wrapper might be less efficient than operations applied directly on the IList.

This method is an O(1) operation.

Version Compatibility

In the .NET Framework version 1.0 and 1.1, calling the GetEnumerator(Int32,Int32) method overload on the ArrayList wrapper returned an enumerator that treated the second argument as an upper bound rather than as a count. In the .NET Framework 2.0 the second argument is correctly treated as a count.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft