XNodeEqualityComparer 类

定义

比较节点以确定其是否相等。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
    interface IEqualityComparer<XNode>
Public NotInheritable Class XNodeEqualityComparer
Implements IEqualityComparer, IEqualityComparer(Of XNode)
继承
XNodeEqualityComparer
实现

注解

此类的目的是实现System.Collections.IEqualityComparer和。 System.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.

构造函数

XNodeEqualityComparer()

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

方法

Equals(Object)

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

(继承自 Object)
Equals(XNode, XNode)

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

GetHashCode()

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

(继承自 Object)
GetHashCode(XNode)

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

GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

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

(继承自 Object)

显式界面实现

IEqualityComparer.Equals(Object, Object)

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

IEqualityComparer.GetHashCode(Object)

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

适用于

另请参阅