mscorlib 2.0.0.0 4.0.0.0 Contravariant To be added.

Provides a mechanism to customize comparison in sort ordering of a generic collection.

To be added.
- Method
  System.Int32 `` `` First to compare. Second to compare.

  Returns the sort order of two instances.

  A containing a value that reflects the sort order of as compared to . The following table defines the conditions under which the returned value is a negative number, zero, or a positive number.

  Value
  Condition
  A negative number
  < .
  Zero
  == .
  A positive number
  > .

  For any objects A, B and C, the following are required to be true:

  Compare(A,A) is required to return zero.

  If Compare(A,B) returns zero then Compare(B,A) is required to return zero.

  If Compare(A,B) is zero, then Compare(B,C) and Compare(A,C) must have the same sign (negative, zero or positive).

  If Compare(B,C) is zero, then Compare(A,B) and Compare(A,C) must have the same sign (negative, zero or positive).

  If Compare(A,B) returns zero and Compare(B,C) returns zero then Compare(A,C) is required to return zero.

  If Compare(A,B) returns a value other than zero then Compare(B,A) is required to return a value of the opposite sign.

  If Compare(A,B) returns a value not equal to zero, and Compare(B,C) returns a value of the same sign as , then Compare(A,C) is required to a value of the same sign as and .

  The exact behavior of this method is unspecified. The intent of this 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.

  2.0.0.0
  4.0.0.0