System.Collections.Hashtable Members

The members of System.Collections.Hashtable are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new, empty instance of the Hashtable class using the default initial capacity, load factor, hash code provider, and comparer.

Initializes a new instance of the Hashtable class by copying the elements from the specified dictionary to the new Hashtable object. The new Hashtable object has an initial capacity equal to the number of elements copied, and uses the default load factor, hash code provider, and comparer.

Initializes a new, empty instance of the Hashtable class using the default initial capacity and load factor, and the specified IEqualityComparer object.

Initializes a new, empty instance of the Hashtable class using the specified initial capacity, and the default load factor, hash code provider, and comparer.

Initializes a new instance of the Hashtable class by copying the elements from the specified dictionary to a new Hashtable object. The new Hashtable object has an initial capacity equal to the number of elements copied, and uses the default load factor and the specified IEqualityComparer object.

Initializes a new instance of the Hashtable class by copying the elements from the specified dictionary to the new Hashtable object. The new Hashtable object has an initial capacity equal to the number of elements copied, and uses the specified load factor, and the default hash code provider and comparer.

Initializes a new, empty instance of the Hashtable class using the default initial capacity and load factor, and the specified hash code provider and comparer.

Initializes a new, empty instance of the Hashtable class using the specified initial capacity and IEqualityComparer, and the default load factor.

Initializes a new, empty instance of the Hashtable class using the specified initial capacity and load factor, and the default hash code provider and comparer.

Initializes a new instance of the Hashtable class by copying the elements from the specified dictionary to the new Hashtable object. The new Hashtable object has an initial capacity equal to the number of elements copied, and uses the default load factor, and the specified hash code provider and comparer. This API is obsolete. For an alternative, see Hashtable.#ctor(IDictionary, IEqualityComparer).

Initializes a new instance of the Hashtable class by copying the elements from the specified dictionary to the new Hashtable object. The new Hashtable object has an initial capacity equal to the number of elements copied, and uses the specified load factor and IEqualityComparer object.

Initializes a new, empty instance of the Hashtable class using the specified initial capacity, hash code provider, comparer, and the default load factor.

Initializes a new, empty instance of the Hashtable class using the specified initial capacity, load factor, and IEqualityComparer object.

Initializes a new instance of the Hashtable class by copying the elements from the specified dictionary to the new Hashtable object. The new Hashtable object has an initial capacity equal to the number of elements copied, and uses the specified load factor, hash code provider, and comparer.

Initializes a new, empty instance of the Hashtable class using the specified initial capacity, load factor, hash code provider, and comparer.

Protected Constructors

Public Properties

[read-only]
Countint.

Gets the number of key/value pairs contained in the Hashtable.

[read-only]
IsFixedSizebool.

Gets a value indicating whether the Hashtable has a fixed size.

[read-only]
IsReadOnlybool.

Gets a value indicating whether the Hashtable is read-only.

[read-only]
IsSynchronizedbool.

Gets a value indicating whether access to the Hashtable is synchronized (thread safe).

default property
Item(object)object. Gets or sets the value in the current instance that is associated with the specified key.
[read-only]
KeysICollection.

Gets an ICollection containing the keys in the Hashtable.

[read-only]
SyncRootobject.

Gets an object that can be used to synchronize access to the Hashtable.

[read-only]
ValuesICollection.

Gets an ICollection containing the values in the Hashtable.

Protected Properties

comparerIComparer.

Gets or sets the IComparer to use for the Hashtable.

[read-only]
EqualityComparerIEqualityComparer.

Gets the IEqualityComparer to use for the Hashtable.

hcpIHashCodeProvider.

Gets or sets the object that can dispense hash codes.

Public Methods

Add(object, object)

Adds an element with the specified key and value into the Hashtable.

Clear()

Removes all elements from the Hashtable.

Clone() : object

Creates a shallow copy of the Hashtable.

Contains(object) : bool

Determines whether the Hashtable contains a specific key.

ContainsKey(object) : bool

Determines whether the Hashtable contains a specific key.

ContainsValue(object) : bool

Determines whether the Hashtable contains a specific value.

CopyTo(Array, int)

Copies the Hashtable elements to a one-dimensional Array instance at the specified index.

GetEnumerator() : IDictionaryEnumerator

Returns an IDictionaryEnumerator that iterates through the Hashtable.

GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Implements the System.Runtime.Serialization.ISerializable interface and returns the data needed to serialize the Hashtable.

OnDeserialization(object)

Implements the System.Runtime.Serialization.ISerializable interface and raises the deserialization event when the deserialization is complete.

Remove(object)

Removes the element with the specified key from the Hashtable.

static
Synchronized(Hashtable) : Hashtable

Returns a synchronized (thread-safe) wrapper for the Hashtable.

Protected Methods

GetHash(object) : int

Returns the hash code for the specified key.

KeyEquals(object, object) : bool

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

Explicitly Implemented Interface Members

IEnumerable.GetEnumerator

Returns an enumerator that iterates through a collection.