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;
The ArrayList wrapper around the IList.
Exception Type | Condition |
---|---|
ArgumentNullException | list is a null reference (in Visual Basic Nothing). |
Adapter does not copy the contents of IList. Instead, it simply creates an ArrayList wrapper around IList; therefore, any changes made to IList also affect the ArrayList.
The ArrayList class provides generic Reverse, BinarySearch and Sort methods. This wrapper can be a vehicle to use those methods on IList. However, the performance of these generic operations through the wrapper may not be as good as operations applied directly on the IList.
ArrayList Class | ArrayList Members | System.Collections Namespace | IList | BinarySearch | Reverse | Sort