Method CompareByPriority
CompareByPriority<T>(T, T, params Comparison<T>[])
Compares two objects using a sequence of comparison delegates, returning the first non-zero result.
public static int CompareByPriority<T>(T x, T y, params Comparison<T>[] comparisons)
Parameters
xTThe first object to compare.
yTThe second object to compare.
comparisonsComparison<T>[]An array of Comparison<T> delegates to use for comparison, in order of priority.
Returns
- int
A signed integer that indicates the relative values of
xandy: less than zero ifxis less thany; zero if they are equal; greater than zero ifxis greater thany.
Type Parameters
TThe type of objects to compare.