NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SortedList Constructor (IComparer, Int32)

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
);

Parameters

comparer
The IComparer implementation to use when comparing keys.

-or-

a null reference (in Visual Basic Nothing) to use the IComparable implementation of each key.

capacity
The initial number of entries that the SortedList can contain.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException initialCapacity is less than zero.

Remarks

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.

See Also

SortedList Class | SortedList Members | System.Collections Namespace | SortedList Constructor Overload List | IComparer | IComparable | Capacity