StateManagedCollection.OnClear 方法

定義

在衍生類別中覆寫時,在 Clear() 方法移除集合的所有項目之前,執行額外工作。When overridden in a derived class, performs additional work before the Clear() method removes all items from the collection.

protected:
 virtual void OnClear();
protected virtual void OnClear ();
abstract member OnClear : unit -> unit
override this.OnClear : unit -> unit
Protected Overridable Sub OnClear ()

備註

衍生自的集合 StateManagedCollection 可以覆寫 OnClear 方法,以在所有專案從集合中移除所有專案之前,先使用方法來執行任何額外的工作 ClearCollections derived from StateManagedCollection can override the OnClear method to perform any additional work before all items are removed from the collection using the Clear method.

適用於

另請參閱