BindingList<T>.OnListChanged(ListChangedEventArgs) 方法

定义

引发 ListChanged 事件。Raises the ListChanged event.

protected:
 virtual void OnListChanged(System::ComponentModel::ListChangedEventArgs ^ e);
protected virtual void OnListChanged (System.ComponentModel.ListChangedEventArgs e);
abstract member OnListChanged : System.ComponentModel.ListChangedEventArgs -> unit
override this.OnListChanged : System.ComponentModel.ListChangedEventArgs -> unit
Protected Overridable Sub OnListChanged (e As ListChangedEventArgs)

参数

e
ListChangedEventArgs

包含事件数据的 ListChangedEventArgsA ListChangedEventArgs that contains the event data.

注解

OnListChanged 方法还允许派生类对事件进行处理而不必附加委托。The OnListChanged method also allows derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.

继承者说明

在派生类中重写 OnListChanged(ListChangedEventArgs) 时,一定要调用基类的 OnListChanged(ListChangedEventArgs) 方法,以便已注册的委托对事件进行接收。When overriding OnListChanged(ListChangedEventArgs) in a derived class, be sure to call the base class's OnListChanged(ListChangedEventArgs) method so that registered delegates receive the event.

适用于

另请参阅