This rule is Obsolete | |
Synopsis: | Use the sender/arguments signature for event handlers |
Language: | C# |
Severity Level: | 6 |
Category: | Delegates and events |
Description: |
The goal of this rule is to have a consistent signature for all event handlers. In general, the event handler's signature should look like this:
public delegate void MyEventHandler(object sender, EventArgs arguments) Using the base class as the sender type allows derived classes to reuse the same event handler. The same applies to the arguments parameter. It is recommended to derive from the .NET Framework's Note: If possible use the generic |