XNodeEqualityComparer XNodeEqualityComparer XNodeEqualityComparer XNodeEqualityComparer Class

定義

比較節點以判斷它們是否相等。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)
繼承
XNodeEqualityComparerXNodeEqualityComparerXNodeEqualityComparerXNodeEqualityComparer
實作

備註

這個類別的用途是實作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.

建構函式

XNodeEqualityComparer() XNodeEqualityComparer() XNodeEqualityComparer() XNodeEqualityComparer()

初始化 XNodeEqualityComparer 類別的新執行個體。Initializes a new instance of the XNodeEqualityComparer class.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Equals(XNode, XNode) Equals(XNode, XNode) Equals(XNode, XNode) Equals(XNode, XNode)

比較兩個節點的值。Compares the values of two nodes.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetHashCode(XNode) GetHashCode(XNode) GetHashCode(XNode) GetHashCode(XNode)

根據 XNode 傳回雜湊程式碼。Returns a hash code based on an XNode.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

IEqualityComparer.Equals(Object, Object) IEqualityComparer.Equals(Object, Object) IEqualityComparer.Equals(Object, Object) IEqualityComparer.Equals(Object, Object)

比較兩個節點的值。Compares the values of two nodes.

IEqualityComparer.GetHashCode(Object) IEqualityComparer.GetHashCode(Object) IEqualityComparer.GetHashCode(Object) IEqualityComparer.GetHashCode(Object)

根據節點的值傳回雜湊程式碼。Returns a hash code based on the value of a node.

適用於

另請參閱