Edit

Share via


Hashtable.EqualityComparer Property

Definition

Gets the IEqualityComparer to use for the Hashtable.

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

Property Value

The IEqualityComparer to use for the Hashtable.

Exceptions

The property is set to a value, but the hash table was created using an IHashCodeProvider and an IComparer.

Remarks

The IEqualityComparer includes both the comparer and the hash code provider. 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.

Retrieving the value of this property is an O(1) operation.

Applies to

See also