XNodeDocumentOrderComparer.IComparer.Compare(Object, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
比較兩個節點以判斷其相對文件順序。
virtual int System.Collections.IComparer.Compare(System::Object ^ x, System::Object ^ y) = System::Collections::IComparer::Compare;
int IComparer.Compare(object x, object y);
abstract member System.Collections.IComparer.Compare : obj * obj -> int
override this.System.Collections.IComparer.Compare : obj * obj -> int
Function Compare (x As Object, y As Object) As Integer Implements IComparer.Compare
參數
傳回
Int32一個 包含 0 若節點相等;-1 若 x 在 之前y;1 若x在 之後 y。
實作
例外狀況
這兩個節點並不共享共同祖先。
這兩個節點並非從 衍生出 XNode來。
備註
我們建議你不要直接使用這門課,而是直接使用這個 InDocumentOrder 方法。 這個類別是該方法內部使用的。