Hashtable.EqualityComparer Hashtable.EqualityComparer Hashtable.EqualityComparer Hashtable.EqualityComparer Property

定义

获取要用于 IEqualityComparerHashtableGets the IEqualityComparer to use for the Hashtable.

protected:
 property System::Collections::IEqualityComparer ^ EqualityComparer { System::Collections::IEqualityComparer ^ get(); };
protected System.Collections.IEqualityComparer EqualityComparer { get; }
member this.EqualityComparer : System.Collections.IEqualityComparer
Protected ReadOnly Property EqualityComparer As IEqualityComparer

属性值

异常

该属性被设置为某个值,但哈希表是使用 IHashCodeProviderIComparer 创建的。The property is set to a value, but the hash table was created using an IHashCodeProvider and an IComparer.

注解

@No__t-0 既包含比较器又包含哈希代码提供程序。The IEqualityComparer includes both the comparer and the hash code provider. 如果 Hashtable 构造函数中使用 @no__t 0,则在 Hashtable 中用作键的对象不需要重写 @no__t 3 和 @no__t 方法。If an IEqualityComparer is used in the Hashtable constructor, the objects used as keys in the Hashtable are not required to override the Object.GetHashCode and Object.Equals methods.

检索此属性的值是 O(1) 操作。Retrieving the value of this property is an O(1) operation.

适用于

另请参阅