Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.CustomComparer<T>

Summary

Encapsulates an IComparer<T> that uses a comparison function provided as a delegate.

Generic type parameters

T The type of elements to be compared.

Constructors

CustomComparer<T>(Comparison<T> comparison)
Constructor.

Static methods

CustomComparer<T>
By(Func<T, string> selector, bool ignoreCase)
Creates and returns a CustomComparer which compares items by comparing the results of a selector function.
CustomComparer<T>
By<TBy>(Func<T, TBy> selector, IComparer<TBy> comparer = null)
CustomComparer<T>
By<TBy>(Func<T, TBy> selector, Comparison<TBy> comparison)

Instance methods

int
Compare(T x, T y)
  • Implements: IComparer<T>.Compare(T, T)
Compares two elements. (see also remarks)
CustomComparer<T>
ThenBy(Func<T, string> selector, bool ignoreCase)
Creates and returns a CustomComparer which uses the current comparer first, and if the current comparer says the items are equal, further compares items by comparing the results of a string selector function.
CustomComparer<T>
ThenBy<TBy>(Func<T, TBy> selector, IComparer<TBy> comparer = null)
Creates and returns a CustomComparer which uses the current comparer first, and if the current comparer says the items are equal, further compares items by comparing the results of a selector function.
CustomComparer<T>
ThenBy<TBy>(Func<T, TBy> selector, Comparison<TBy> comparison)