O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C.2. Naming C# events

Delegate names which are to be used for declaring events (event handlers) should end with EventHandler to differentiate them from other delegates. If your event handler takes in the standard reference to sender/event source and event argument object parameters, use the variable names sender and e. For example:

delegate void MouseEventHandler(object sender, MouseEvent e);

Event argument class names should end with EventArgs. For example:

public class MyEventArgs: EventArgs{...}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required