New to Telerik UI for WinForms? Start a free 30-day trial

A comparer of key-value pairs based on a comparison of the respective keys.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Type Parameters:

TKey

The type of the key.

TValue

The type of the value.

Syntax:

C#
public class KeyValuePairComparer<TKey, TValue>

Inheritance: objectKeyValuePairComparer<TKey, TValue>

Constructors

Initializes a new instance of the KeyValuePairComparer<TKey, TValue> class.

C#
public KeyValuePairComparer()

Initializes a new instance of the KeyValuePairComparer<TKey, TValue> class.

C#
public KeyValuePairComparer(Comparison<TKey> comparison)
Parameters:comparisonComparison<TKey>

The comparison.

Initializes a new instance of the KeyValuePairComparer<TKey, TValue> class.

C#
public KeyValuePairComparer(IComparer<TKey> comparer)
Parameters:comparerIComparer<TKey>

The comparer.

Methods

Compares the two key pairs.

C#
public int Compare(KeyValuePair<TKey, TValue> x, KeyValuePair<TKey, TValue> y)
Parameters:xKeyValuePair<TKey, TValue>

The x.

yKeyValuePair<TKey, TValue>

The y.

Returns:

int

Compares the two values.

C#
public int Compare(TKey x, TKey y)
Parameters:xTKey

The x.

yTKey

The y.

Returns:

int