Total .NET Analyzer Rule Documentation |
|
EventFirstArgumentName Rule
Name the first parameter of an event 'sender'.
Remarks
Microsoft recommends that there should always be two parameters for all events. The first parameter of the event should be named 'sender'.
Resolution
Modify the event to have the event sender as the first parameter, and name this parameter 'sender'. For example, the following event handlers follow Microsoft's guidelines:
' VB
Public Delegate Sub MouseEventHandler(sender As Object, e As EventArgs)
// C#
public delegate void MouseEventHandler(object sender, EventArgs e);
See Also
Event Naming Guidelines
Total .NET Analyzer Event Argument Count rule
Total .NET Analyzer First Event Argument Type rule