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.

適用於

另請參閱