System.Collections.CollectionBase.Clear Method

Removes all objects from the CollectionBase instance. This method cannot be overridden.

Syntax

public void Clear ()

Remarks

CollectionBase.Count is set to zero.

This method is an O(n) operation, where n is CollectionBase.Count.

To perform custom actions before or after the collection is cleared, override the protected CollectionBase.OnClear or CollectionBase.OnClearComplete method.

Requirements

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