DictionaryBase.OnSetComplete(Object, Object, Object) 方法

定义

当在 DictionaryBase 实例中设置值后执行其他自定义进程。Performs additional custom processes after setting a value in the DictionaryBase instance.

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

参数

key
Object

要定位的元素的键。The key of the element to locate.

oldValue
Object

key 相关联的元素的旧值。The old value of the element associated with key.

newValue
Object

key 相关联的元素的新值。The new value of the element associated with key.

注解

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

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

OnSet(Object, Object, Object) 在标准集行为之前调用,而在 OnSetComplete(Object, Object, Object) 标准集行为后调用。OnSet(Object, Object, Object) is invoked before the standard Set behavior, whereas OnSetComplete(Object, Object, Object) is invoked after the standard Set behavior.

适用于

另请参阅