XNodeEqualityComparer Class

Definition

比较节点以确定其是否相等。Compares nodes to determine whether they are equal. 无法继承此类。This class cannot be inherited.

public ref class XNodeEqualityComparer sealed : System::Collections::Generic::IEqualityComparer<System::Xml::Linq::XNode ^>, System::Collections::IEqualityComparer
public sealed class XNodeEqualityComparer : System.Collections.Generic.IEqualityComparer<System.Xml.Linq.XNode>, System.Collections.IEqualityComparer
type XNodeEqualityComparer = class
    interface IEqualityComparer<XNode>
    interface IEqualityComparer
type XNodeEqualityComparer = class
    interface IEqualityComparer
    interface IEqualityComparer<XNode>
Public NotInheritable Class XNodeEqualityComparer
Implements IEqualityComparer, IEqualityComparer(Of XNode)
Inheritance
XNodeEqualityComparer
Implements

Remarks

此类的目的是实现 System.Collections.IEqualityComparerSystem.Collections.Generic.IEqualityComparer<T>The purpose of this class is to implement System.Collections.IEqualityComparer and System.Collections.Generic.IEqualityComparer<T>. 需要标识的类(如 Dictionary<TKey,TValue>)需要一个实现这些接口之一的类的实例。Classes that require identity (such as Dictionary<TKey,TValue> ) require an instance of a class that implements one of these interfaces.

Constructors

XNodeEqualityComparer()

初始化 XNodeEqualityComparer 类的新实例。Initializes a new instance of the XNodeEqualityComparer class.

Methods

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Equals(XNode, XNode)

比较两个节点的值。Compares the values of two nodes.

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetHashCode(XNode)

返回基于 XNode 的哈希代码。Returns a hash code based on an XNode.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEqualityComparer.Equals(Object, Object)

比较两个节点的值。Compares the values of two nodes.

IEqualityComparer.GetHashCode(Object)

返回基于节点值的哈希代码。Returns a hash code based on the value of a node.

Applies to

See also