ArrayList.Adapter Method
Creates an ArrayList wrapper for a specific IList.
[Visual Basic] Public Shared Function Adapter( _ ByVal list As IList _ ) As ArrayList [C#] public static ArrayList Adapter( IList list ); [C++] public: static ArrayList* Adapter( IList* list ); [JScript] public static function Adapter( list : IList ) : ArrayList;
Parameters
- list
- The IList to wrap.
Return Value
The ArrayList wrapper around the IList.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentNullException | list is a null reference (Nothing in Visual Basic). |
Remarks
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.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard
See Also
ArrayList Class | ArrayList Members | System.Collections Namespace | IList | BinarySearch | Reverse | Sort