TestId.CompareTo 方法 (Object)

將目前的執行個體與相同型別的另一個物件相比較,並傳回整數,這個整數表示目前的執行個體在排序次序中,位於另一個物件之前、之後或相同位置。

命名空間:  Microsoft.VisualStudio.TestTools.Common
組件:  Microsoft.VisualStudio.QualityTools.Common (在 Microsoft.VisualStudio.QualityTools.Common.dll 中)

語法

'宣告
Public Function CompareTo ( _
    other As Object _
) As Integer
public int CompareTo(
    Object other
)
public:
virtual int CompareTo(
    Object^ other
) sealed
abstract CompareTo : 
        other:Object -> int 
override CompareTo : 
        other:Object -> int 
public final function CompareTo(
    other : Object
) : int

參數

傳回值

型別:System.Int32
整數,這個整數表示這個執行個體在排序次序中,位於指定的物件之前、之後或相同位置。

實作

IComparable.CompareTo(Object)

例外狀況

例外狀況 條件
[ArgumentException]

other物件不是TestId物件。

.NET Framework 安全性

請參閱

參考

TestId 類別

CompareTo 多載

Microsoft.VisualStudio.TestTools.Common 命名空間