CollectionBase.OnRemoveComplete(Int32, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Performs additional custom processes after removing an element from the CollectionBase instance.
protected:
virtual void OnRemoveComplete(int index, System::Object ^ value);
protected virtual void OnRemoveComplete (int index, object value);
protected virtual void OnRemoveComplete (int index, object? value);
abstract member OnRemoveComplete : int * obj -> unit
override this.OnRemoveComplete : int * obj -> unit
Protected Overridable Sub OnRemoveComplete (index As Integer, value As Object)
Parameters
- index
- Int32
The zero-based index at which value
can be found.
- value
- Object
The value of the element to remove from index
.
Remarks
The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified element is removed.
The On* methods are invoked only on the instance returned by the List property, but not on the instance returned by the InnerList property.
The collection reverts back to its previous state if one of the following occurs:
The process fails.
This method is overridden to throw an exception.
The default implementation of this method is an O(1)
operation.
Notes to Inheritors
This method allows implementers to define processes that must be performed after removing the element from the underlying ArrayList. By defining this method, implementers can add functionality to inherited methods without having to override all other methods.
OnRemove(Int32, Object) is invoked before the standard Remove behavior, whereas OnRemoveComplete(Int32, Object) is invoked after the standard Remove behavior.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈