Array.IStructuralComparable.CompareTo(Object, IComparer) Метод
Определение
Определяет позицию текущего объекта коллекции относительно другого объекта в порядке сортировки (находится перед другим объектов, на одной позиции с ним или после другого объекта).Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order.
virtual int System.Collections.IStructuralComparable.CompareTo(System::Object ^ other, System::Collections::IComparer ^ comparer) = System::Collections::IStructuralComparable::CompareTo;
int IStructuralComparable.CompareTo (object other, System.Collections.IComparer comparer);
Function CompareTo (other As Object, comparer As IComparer) As Integer Implements IStructuralComparable.CompareTo
Параметры
- other
- Object
Объект для сравнения с текущим экземпляром.The object to compare with the current instance.
- comparer
- IComparer
Объект, сравнивающий текущий объект и объект other
.An object that compares the current object and other
.
Возвраты
Целое число, определяющее, как соотносятся между собой текущий объект коллекции и другой объект. Возможные соотношения показаны в следующей таблице.An integer that indicates the relationship of the current collection object to other, as shown in the following table.
Возвращаемое значениеReturn value | ОписаниеDescription |
---|---|
-1-1 | Текущий экземпляр стоит перед объектом other .The current instance precedes other .
|
00 | Текущий экземпляр и объект other равны.The current instance and other are equal.
|
11 | Текущий экземпляр стоит после объекта other .The current instance follows other .
|
Реализации
Комментарии
Этот член представляет собой явную реализацию члена интерфейса.This member is an explicit interface member implementation. Он может использоваться, только если экземпляр Array приведен к типу интерфейса IStructuralComparable.It can be used only when the Array instance is cast to an IStructuralComparable interface.