Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order.
An integer that indicates the relationship of the current collection object to other, as shown in the following table.
-1 The current instance precedes other.
0 The current instance and other are equal.
1 The current instance follows other.
The IStructuralComparable.CompareTo(object, IComparer) method supports custom structural comparison and sorting of array and tuple objects. The IStructuralComparable.CompareTo(object, IComparer) method calls the comparer object's IComparer.Compare(object, object) method to compare individual array elements or tuple components, starting with the first element or component. The individual calls to IComparer.Compare(object, object) end and the IStructuralComparable.CompareTo(object, IComparer) method returns a value when one of the following conditions becomes true:
The IComparer.Compare(object, object) method returns -1.
The IComparer.Compare(object, object) method returns 1.
The IComparer.Compare(object, object) method is called for the last element or component in the collection object.