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

System.Collections.Hashtable.Clear Method

Removes all entries from the current instance. [Edit]

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public virtual void Clear ()

Exceptions

TypeReason
NotSupportedExceptionThe current instance is read-only. [Edit]

Remarks

Note: This method is implemented to support the IDictionary interface.

Operation
As described above.

The value of each key and value in the current instance is set to null. The Hashtable.Count property of the current instance is set to zero. The capacity of the current instance remains unchanged.

If the current instance is empty, it remains unchanged and no exception is thrown.

[Edit]

Requirements

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