Class
KeyValuePairComparer<TKey, TValue>

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

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Type Parameters:

TKey

The type of the key.

TValue

The type of the value.

Syntax:

cs-api-definition
public class KeyValuePairComparer<TKey, TValue> : IComparer<KeyValuePair<TKey, TValue>>

Inheritance: objectKeyValuePairComparer<TKey, TValue>

Implements: IComparer<KeyValuePair<TKey, TValue>>

Constructors

KeyValuePairComparer()

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

Declaration

cs-api-definition
public KeyValuePairComparer()

KeyValuePairComparer(Comparison<TKey>)

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

Declaration

cs-api-definition
public KeyValuePairComparer(Comparison<TKey> comparison)

Parameters

comparison

Comparison<TKey>

The comparison.

KeyValuePairComparer(IComparer<TKey>)

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

Declaration

cs-api-definition
public KeyValuePairComparer(IComparer<TKey> comparer)

Parameters

comparer

IComparer<TKey>

The comparer.

Methods

Compare(KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>)

Compares the two key pairs.

Declaration

cs-api-definition
public int Compare(KeyValuePair<TKey, TValue> x, KeyValuePair<TKey, TValue> y)

Parameters

x

KeyValuePair<TKey, TValue>

The x.

y

KeyValuePair<TKey, TValue>

The y.

Returns

int

Implements IComparer<KeyValuePair<TKey, TValue>>.Compare(KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>)

Compare(TKey, TKey)

Compares the two values.

Declaration

cs-api-definition
public int Compare(TKey x, TKey y)

Parameters

x

TKey

The x.

y

TKey

The y.

Returns

int