This documentation is archived and is not being maintained.

SortedDictionary.Comparer Property

Gets the IComparer used to order the elements of the SortedDictionary.

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

public IComparer<TKey> Comparer { get; }
/** @property */
public IComparer<TKey> get_Comparer ()

public function get Comparer () : IComparer<TKey>

Not applicable.

Property Value

The IComparer used to order the elements of the SortedDictionary

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

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

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0