Table of Contents

Method CompareByPriority

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

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

x T

The first object to compare.

y T

The second object to compare.

comparisons Comparison<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 x and y: less than zero if x is less than y; zero if they are equal; greater than zero if x is greater than y.

Type Parameters

T

The type of objects to compare.