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.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 類別的新執行個體。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 的淺層複本 (Shallow Copy)。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.

適用於

另請參閱