SortedSet(Of T) Constructor (IComparer(Of T))
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the SortedSet(Of T) class that uses a specified comparer.
Assembly: System (in System.dll)
Parameters
- comparer
- Type: System.Collections.Generic.IComparer(Of T)
The default comparer to use for comparing objects.
| Exception | Condition |
|---|---|
| ArgumentNullException | comparer is Nothing. |
If comparer does not implement IComparable(Of T), you must specify an IComparer(Of T) object to be used.
The following example defines a comparer (ByFileExtension) that is used to construct a sorted set that sorts file names by their extensions. This code example is part of a larger example provided for the SortedSet(Of T) class.