Mono Class Library: System.Collections.Hashtable Overview | Members

System.Collections.Hashtable.Item Property

Gets or sets the value in the current instance that is associated with the specified key. [Edit]

This is the default property for this class.

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

Parameters

key
The key whose value to get or set. [Edit]

Value

The value in the current instance that is associated with key. If key is not contained in the current instance, attempting to get it returns null, and attempting to set it creates a new entry using key . [Edit]

Exceptions

TypeReason
ArgumentNullExceptionkey is null. [Edit]
NotSupportedException

The property is being set and the current instance is read-only.

The property is being set, key is not contained in the current instance, and the current instance has a fixed size.

[Edit]

Remarks

Note: This property provides the ability to access a specific element in the current instance using the following notation: myCollection[key] .

Operation
As described above.

If this property is being set and key is already contained in the current instance, the value associated with the old key is replaced.

[Edit]

Requirements

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