Interface IComparerBuilder<T>
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
Convenience interface for providing a starting point for chaining comparers.
public interface IComparerBuilder<T>
Type Parameters
T
The comparison type.
- Extension Methods
Methods
OrderByDescending<TValue>(Func<T, TValue>)
Creates a derived comparer based on the given parent comparer. The returned comparer will sort elements using the parent comparer first. If the parent considers the values equal elements will be sorted in descending order based on the values returned by the provided selector. The selector values will be compared using the default comparer for the return type of the selector.
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 derived comparer based on the given parent comparer. The returned comparer will sort elements using the parent comparer first. If the parent considers the values equal elements will be sorted 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.
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 derived comparer based on the given parent comparer. The returned comparer will sort elements using the parent comparer first. If the parent considers the values equal elements will be sorted in ascending order based on the values returned by the provided selector. The selector values will be compared using the default comparer for the return type of the selector.
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 derived comparer based on the given parent comparer. The returned comparer will sort elements using the parent comparer first. If the parent considers the values equal elements will be sorted 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.
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.