Table of Contents

Class OrderedComparer<T>

Namespace
ReactiveUI
Assembly
ReactiveUI.dll

Convenience class providing a starting point for chaining comparers.

public static class OrderedComparer<T> : Object

Type Parameters

T

The comparison type.

Inheritance
OrderedComparer<T>

Methods

OrderByDescending<TValue>(Func<T, TValue>)

Creates a comparer that will sort elements in descending order based on the values returned by the provided selector. The values will be compared using the default comparer for the return type of the selector.

public static IComparer<T> OrderByDescending<TValue>(Func<T, TValue> selector)

Parameters

selector Func<T, TValue>

A function supplying the values for the comparer.

Returns

IComparer<T>

A comparer.

Type Parameters

TValue

The value type.

OrderByDescending<TValue>(Func<T, TValue>, IComparer<TValue>)

Creates a comparer that will sort elements in descending order based on the values returned by the provided selector. The selector values will be compared using the provided comparer or the default comparer for the return type of the selector if no comparer is specified.

public static IComparer<T> OrderByDescending<TValue>(Func<T, TValue> selector, IComparer<TValue> comparer)

Parameters

selector Func<T, TValue>

A function supplying the values for the comparer.

comparer IComparer<TValue>

The comparer to use when comparing the values returned by the selector. The default comparer for that type will be used if this parameter is null.

Returns

IComparer<T>

A comparer.

Type Parameters

TValue

The value type.

OrderBy<TValue>(Func<T, TValue>)

Creates a comparer that will sort elements in ascending order based on the values returned by the provided selector. The values will be compared using the default comparer for the return type of the selector.

public static IComparer<T> OrderBy<TValue>(Func<T, TValue> selector)

Parameters

selector Func<T, TValue>

A function supplying the values for the comparer.

Returns

IComparer<T>

A comparer.

Type Parameters

TValue

The value type.

OrderBy<TValue>(Func<T, TValue>, IComparer<TValue>)

Creates a comparer that will sort elements in ascending order based on the values returned by the provided selector. The selector values will be compared using the provided comparer or the default comparer for the return type of the selector if no comparer is specified.

public static IComparer<T> OrderBy<TValue>(Func<T, TValue> selector, IComparer<TValue> comparer)

Parameters

selector Func<T, TValue>

A function supplying the values for the comparer.

comparer IComparer<TValue>

The comparer to use when comparing the values returned by the selector. The default comparer for that type will be used if this parameter is null.

Returns

IComparer<T>

A comparer.

Type Parameters

TValue

The value type.