System.Collections.Generic.ICollection<T>.Clear Method

Removes all items from the ICollection`1.

Syntax

public void Clear ()

Exceptions

TypeReason
NotSupportedExceptionThe current collection is read-only.

Remarks

ICollection`1.Count must be set to 0, and references to other objects from elements of the collection must be released.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0