Although sometimes you may want an event that can only be raised by the base class, most of the time, you should enable the derived class to invoke base class events.
虽然有时您可能会想要使用只能由基底类别所引发的事件,但是在多数情形下,您应该启用衍生类别来叫用基底类别事件。
A class member, method, field, property, or event, on a derived class that is overriding a virtual member of the base class can declare that member as sealed.
若类别成员、方法、栏位、属性或事件是位于覆写基底类别虚拟成员的衍生类别上,则可宣告为密封。
To do this, you can create a protected invoking method in the base class that wraps the event.
为此,您可以在包含该事件的基类中创建一个受保护的调用方法。
应用推荐