| Variables: |
|---|
| Constructors: |
|---|
| Functions: |
|---|
public System.Int32 Compare(System.Object x, System.Object y) Returns the sort order of two System.Object instances. Parameter x: First System.Object to compare. Parameter y: Second System.Object to compare. Returns: A System.Int32 containing a value that reflects the sort order of x as compared to y. The following table defines the conditions under which the returned value is a negative number, zero, or a positive number. For any objects A, B, and C, the following are required to be true: System.Collections.IComparer.Compare(System.Object,System.Object) (A, A) is required to return zero. If System.Collections.IComparer.Compare(System.Object,System.Object)(A, B) returns zero, then System.Collections.IComparer.Compare(System.Object,System.Object) (B, A) is required to return zero. If System.Collections.IComparer.Compare(System.Object,System.Object)(A, B) returns zero and System.Collections.IComparer.Compare(System.Object,System.Object)(B, C) returns zero then System.Collections.IComparer.Compare(System.Object,System.Object) (A, C) is required to return zero. If System.Collections.IComparer.Compare(System.Object,System.Object)(A, B) returns a value other than zero, then System.Collections.IComparer.Compare(System.Object,System.Object) (B, A) is required to return a value of the opposite sign. If System.Collections.IComparer.Compare(System.Object,System.Object)(A, B) returns a value x not equal to zero, and System.Collections.IComparer.Compare(System.Object,System.Object)(B, C) returns a value y of the same sign as x, then System.Collections.IComparer.Compare(System.Object,System.Object) (A, C) is required to return a value of the same sign as x and y. The exact ordering of this method is unspecified. The intent of the method is to provide a mechanism that orders instances of a class in a manner that is consistent with the mathematical definitions of the relational operators (<, >, and ==), without regard for class-specific definitions of the operators. This interface is used in conjunction with the System.Array.Sort(System.Array) and System.Array.BinarySearch(System.Array,System.Object) methods. |