Comparer Property

SortedDictionary(Of TKey, TValue).Comparer Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the IComparer(Of T) used to order the elements of the SortedDictionary(Of TKey, TValue).

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

'Declaration
Public ReadOnly Property Comparer As IComparer(Of TKey)

Property Value

Type: System.Collections.Generic.IComparer(Of TKey)
The IComparer(Of T) used to order the elements of the SortedDictionary(Of TKey, TValue)

SortedDictionary(Of TKey, TValue) requires a comparer implementation to perform key comparisons. You can specify an implementation of the IComparer(Of T) generic interface by using a constructor that accepts a comparer parameter. If you do not, the default generic equality comparer, Comparer(Of T).Default, is used. If type TKey implements the System.IComparable(Of T) generic interface, the default comparer uses that implementation.

Getting the value of this property is an O(1) operation.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft