System.Comparison<T> Delegate

Represents the method that compares two objects of the same type.

Syntax

public delegate int Comparison<T> (T x, T y)

Type Parameters

T
Documentation for this section has not yet been entered.

Parameters

x
The first object to compare.
y
The second object to compare.

Returns

A int containing a value that reflects the sort order of the objects.

ValueCondition
Less than zero x is less than y.
Zero x equals y.
Greater than zero x is greater than y.

A int containing a value that reflects the sort order of the objects.

ValueCondition
Less than zero x is less than y.
Zero x equals y.
Greater than zero x is greater than y.
Documentation for this section has not yet been entered.

Remarks

This delegate is used by the Array.Sort``1(``0[], Comparison<``0>) method overload of the Array class and the List`1.Sort(Comparison<`0>) method overload of the List`1 class to sort the elements of an array or list.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0