Array.IStructuralComparable.CompareTo(Object, IComparer) 方法

定義

判斷目前的集合物件在排序次序中位於另一個物件之前、相同位置或之後。

 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);
abstract member System.Collections.IStructuralComparable.CompareTo : obj * System.Collections.IComparer -> int
override this.System.Collections.IStructuralComparable.CompareTo : obj * System.Collections.IComparer -> int
Function CompareTo (other As Object, comparer As IComparer) As Integer Implements IStructuralComparable.CompareTo

參數

other
Object

要與目前執行個體比較的物件。

comparer
IComparer

將目前的物件與 other 相比較的物件。

傳回

Int32

整數,表示目前集合物件與 other 的關聯性,如下表所示。

傳回值 描述
-1 目前的執行個體在 other 之前。
0 目前的執行個體與 other 相等。
1 目前的執行個體在 other 之後。

實作

備註

這個成員是明確介面成員實作, 只有在 Array 執行個體轉換成 IStructuralComparable 介面時,才能使用這個成員。

適用於