CollectionBase.OnClearComplete 方法

定义

在清除 CollectionBase 实例的内容之后执行其他自定义进程。Performs additional custom processes after clearing the contents of the CollectionBase instance.

protected:
 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 * 方法仅在 List 属性返回的实例上调用,而不是在 InnerList 属性返回的实例上调用。The On* methods are invoked only on the instance returned by the List property, but not on the instance returned by the InnerList property.

此方法的默认实现是 O(1) 操作。The default implementation of this method is an O(1) operation.

继承者说明

此方法允许实现者定义从基础 ArrayList中删除所有元素后必须执行的过程。This method allows implementers to define processes that must be performed after deleting all the elements from the underlying ArrayList. 通过定义此方法,实施者可以向继承的方法添加功能,而无需重写所有其他方法。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.

适用于

另请参阅