SortedSet(T) Constructor (IComparer(T))
Collapse the table of content
Expand the table of content

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.

Namespace:  System.Collections.Generic
Assembly:  System (in System.dll)

'Declaration
Public Sub New ( _
	comparer As IComparer(Of T) _
)

Parameters

comparer
Type: System.Collections.Generic.IComparer(Of T)
The default comparer to use for comparing objects.

ExceptionCondition
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.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft