mscorlib(4.0.0.0) API with additions
System.Collections.IComparer Interface Reference

Exposes a method that compares two objects. More...

Inheritance diagram for System.Collections.IComparer:
[legend]

Public Member Functions

int Compare (object x, object y)
 Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. More...
 

Detailed Description

Exposes a method that compares two objects.

Definition at line 8 of file IComparer.cs.

Member Function Documentation

◆ Compare()

int System.Collections.IComparer.Compare ( object  x,
object  y 
)

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

Parameters
xThe first object to compare.
yThe second object to compare.
Returns
A signed integer that indicates the relative values of x and y , as shown in the following table.Value Meaning Less than zero x is less than y . Zero x equals y . Greater than zero x is greater than y .
Exceptions
T:System.ArgumentExceptionNeither x nor y implements the T:System.IComparable interface.-or- x and y are of different types and neither one can handle comparisons with the other.

Implemented in System.StringComparer, System.Collections.Comparer, and System.Collections.CaseInsensitiveComparer.


The documentation for this interface was generated from the following file: