Bewerken

Delen via


XNodeDocumentOrderComparer.IComparer.Compare(Object, Object) Method

Definition

Compares two nodes to determine their relative document order.

 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

Parameters

x
Object

The first XNode to compare.

y
Object

The second XNode to compare.

Returns

An Int32 that contains 0 if the nodes are equal; -1 if x is before y; 1 if x is after y.

Implements

Exceptions

The two nodes do not share a common ancestor.

The two nodes are not derived from XNode.

Remarks

We recommend that instead of using this class directly, you use the InDocumentOrder method. This class is used internally by that method.

Applies to