I understand the benefits of using the standard MS event handler delegate signature as it allows you to easily expand on the information passed through the event with out breaki
You can do anything the wrong way if you're the only one who has to deal with it. But it's not a bad idea to learn standards and stick to them so that you keep good habits when you're working on code with others.
So I'll make you a deal. If you promise to do it the right way, I'll give you a code snippet that'll make it much less of a pain. Just put this in a .snippet file, and put that file in:
My Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets\
(or Visual Studio 2005 if applicable)
And here's the snippet; use it in VS by typing ev2Generic and hitting Tab:
Generic event with two types/arguments.
ev2Generic
Code snippet for event handler and On method
Kyralessa
Expansion
type1
Type of the first property in the EventArgs subclass.
propertyType1
arg1Name
Name of the first argument in the EventArgs subclass constructor.
property1Name
property1Name
Name of the first property in the EventArgs subclass.
Property1Name
type2
Type of the second property in the EventArgs subclass.
propertyType2
arg2Name
Name of the second argument in the EventArgs subclass constructor.
property2Name
property2Name
Name of the second property in the EventArgs subclass.
Property2Name
eventName
Name of the event
NameOfEvent
$eventName$;
protected virtual void On$eventName$($eventName$EventArgs e)
{
var handler = $eventName$;
if (handler != null)
handler(this, e);
}]]>