System.Collections.Hashtable.KeyEquals Method

Compares a specific object with a specific key in the Hashtable.

Syntax

protected virtual bool KeyEquals (object item, object key)

Parameters

item
The object to compare with key.
key
The key in the Hashtable to compare with item.

Returns

true if item and key are equal; otherwise, false.

Exceptions

TypeReason
ArgumentNullException

item is null.

-or-

key is null.

Remarks

If the hash table was created with a specific IComparer implementation, this method uses that comparer; that is, IComparer.Compare(object, object) (item, key). Otherwise, it uses item.Equals(key).

This method is an O(1) operation.

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0