Creates an empty SortedList with the specified initial capacity, sorted according to the specified IComparer interface.
[Visual Basic] Overloads Public Sub New( _ ByVal comparer As IComparer, _ ByVal capacity As Integer _ ) [C#] public SortedList( IComparer comparer, int capacity ); [C++] public: SortedList( IComparer* comparer, int capacity ); [JScript] public function SortedList( comparer : IComparer, capacity : int );
-or-
a null reference (in Visual Basic Nothing) to use the IComparable implementation of each key.
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | initialCapacity is less than zero. |
When adding elements to the list and the number of elements exceeds the capacity, the capacity is doubled.
The elements are sorted according to the specified IComparer implementation. If comparer is a null reference (Nothing), the IComparable implementation of each key is used.
SortedList Class | SortedList Members | System.Collections Namespace | SortedList Constructor Overload List | IComparer | IComparable | Capacity