<PackageReference Include="System.Collections.NonGeneric" Version="4.0.1-beta-23409" />

Hashtable

Represents a collection of key/value pairs that are organized based on the hash code of the key.To browse the .NET Framework source code for this type, see the Reference Source.
public virtual int Count { get; }

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

Gets the IEqualityComparer to use for the Hashtable.

public virtual bool IsFixedSize { get; }

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

public virtual bool IsReadOnly { get; }

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

public virtual bool IsSynchronized { get; }

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

public virtual object this[object key] { get; set; }

Gets or sets the value associated with the specified key.

public virtual ICollection Keys { get; }

Gets an ICollection containing the keys in the Hashtable.

public virtual object SyncRoot { get; }

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

public virtual ICollection Values { get; }

Gets an ICollection containing the values in the Hashtable.

public Hashtable()

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

public Hashtable(int capacity)

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

public Hashtable(int capacity, float loadFactor)

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.

public Hashtable(int capacity, float loadFactor, IEqualityComparer equalityComparer)

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

public Hashtable(IEqualityComparer equalityComparer)

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

public Hashtable(int capacity, IEqualityComparer equalityComparer)

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

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.

public Hashtable(IDictionary d, float loadFactor)

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.

public Hashtable(IDictionary d, IEqualityComparer equalityComparer)

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.

public Hashtable(IDictionary d, float loadFactor, IEqualityComparer equalityComparer)

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.

public static Hashtable Synchronized(Hashtable table)

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

public virtual void Add(object key, object value)

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

public virtual void Clear()

Removes all elements from the Hashtable.

public virtual object Clone()

Creates a shallow copy of the Hashtable.

public virtual bool Contains(object key)

Determines whether the Hashtable contains a specific key.

public virtual bool ContainsKey(object key)

Determines whether the Hashtable contains a specific key.

public virtual bool ContainsValue(object value)

Determines whether the Hashtable contains a specific value.

public virtual void CopyTo(Array array, int arrayIndex)

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

Returns an IDictionaryEnumerator that iterates through the Hashtable.

protected virtual int GetHash(object key)

Returns the hash code for the specified key.

protected virtual bool KeyEquals(object item, object key)

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

public virtual void Remove(object key)

Removes the element with the specified key from the Hashtable.