Class EntryKeyOverValueComparer<TKey, TValue>
Represents a KeyValuePair<TKey, TValue> comparer, where the result relies on the comparison result between the keys, and then the values, if the keys are equal.
public sealed class EntryKeyOverValueComparer<TKey, TValue> : IFullKeyValuePairComparer<TKey, TValue>, IKeyValuePairComparer<TKey, TValue>, IComparer<KeyValuePair<TKey, TValue>> where TKey : IComparable<TKey> where TValue : IComparable<TValue>
Type Parameters
TKeyThe type of the key.
TValueThe type of the value.
- Inheritance
-
EntryKeyOverValueComparer<TKey, TValue>
- Implements
-
IFullKeyValuePairComparer<TKey, TValue>IKeyValuePairComparer<TKey, TValue>IComparer<KeyValuePair<TKey, TValue>>
- Inherited Members
- Extension Methods
Fields
Default
The default instance of the EntryKeyOverValueComparer<TKey, TValue> class.
public static readonly EntryKeyOverValueComparer<TKey, TValue> Default
Field Value
- EntryKeyOverValueComparer<TKey, TValue>
Methods
Compare(KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>)
Compares two KeyValuePair<TKey, TValue> instances given this comparer's rules.
public int Compare(KeyValuePair<TKey, TValue> left, KeyValuePair<TKey, TValue> right)
Parameters
leftKeyValuePair<TKey, TValue>The left value to compare.
rightKeyValuePair<TKey, TValue>The right value to compare.
Returns
- int
The comparison result between the keys, if not 0, otherwise the comparison result between the values. For all comparisons, order is matched.