DictionaryBase.OnClearComplete 方法


在清除 DictionaryBase 執行個體的內容後,執行額外的自訂處理序。Performs additional custom processes after clearing the contents of the DictionaryBase instance.

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


此方法的預設執行是要由衍生類別覆寫,以在清除集合之後執行某些動作。The default implementation of this method is intended to be overridden by a derived class to perform some action after the collection is cleared.

On * 方法只會在屬性所傳回的實例上叫用 Dictionary ,而不會在屬性所傳回的實例上叫用 InnerHashtableThe On* methods are invoked only on the instance returned by the Dictionary property, but not on the instance returned by the InnerHashtable property.

此方法的預設實作為作業 O(1)The default implementation of this method is an O(1) operation.


這個方法可讓實作者定義必須從基礎刪除所有元素之後執行的處理常式 HashtableThis method allows implementers to define processes that must be performed after deleting all the elements from the underlying Hashtable. 藉由定義此方法,實施者可以將功能加入至繼承的方法,而不需要覆寫所有其他方法。By defining this method, implementers can add functionality to inherited methods without having to override all other methods.

OnClear() 會在標準清除行為之前叫用,而 OnClearComplete() 是在標準清楚行為之後叫用。OnClear() is invoked before the standard Clear behavior, whereas OnClearComplete() is invoked after the standard Clear behavior.