DictionaryBase.OnInsertComplete(Object, Object) 方法

定义

在向 DictionaryBase 实例中插入新元素之后执行其他自定义进程。Performs additional custom processes after inserting a new element into the DictionaryBase instance.

protected:
 virtual void OnInsertComplete(System::Object ^ key, System::Object ^ value);
protected virtual void OnInsertComplete (object key, object value);
protected virtual void OnInsertComplete (object key, object? value);
abstract member OnInsertComplete : obj * obj -> unit
override this.OnInsertComplete : obj * obj -> unit
Protected Overridable Sub OnInsertComplete (key As Object, value As Object)

参数

key
Object

要插入的元素的键。The key of the element to insert.

value
Object

要插入的元素的值。The value of the element to insert.

注解

此方法的默认实现旨在由派生类重写,以便在插入指定元素后执行某一操作。The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified element is inserted.

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 inserting the element into the underlying Hashtable. 通过定义此方法,实施者可以向继承的方法添加功能,而无需重写所有其他方法。By defining this method, implementers can add functionality to inherited methods without having to override all other methods.

OnInsert(Object, Object) 在标准插入行为之前调用,而在 OnInsertComplete(Object, Object) 标准插入行为后调用。OnInsert(Object, Object) is invoked before the standard Insert behavior, whereas OnInsertComplete(Object, Object) is invoked after the standard Insert behavior.

适用于

另请参阅