Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 644 Bytes

File metadata and controls

9 lines (8 loc) · 644 Bytes
rule_id 1225
rule_category misc
title Use a protected virtual method to raise each event
severity 2

Complying with this guideline allows derived classes to handle a base class event by overriding the protected method. The name of the protected virtual method should be the same as the event name prefixed with On. For example, the protected virtual method for an event named TimeChanged is named OnTimeChanged.

Note: Derived classes that override the protected virtual method are not required to call the base class implementation. The base class must continue to work correctly even if its implementation is not called.