Delegate parameters

  • Thread starter Thread starter John Baro
  • Start date Start date
J

John Baro

It appears most of the delegates in VSNET have a sender parameter and an
eventargs parameter. Even if the eventargs parameter is empty.
What are the benefits of following this pattern when developing my own
delegates?
i.e
instead of
public void MyDelegate(string parameter);
we have
public void MyDelegate(object sender, MyInheritedEventargs parameter);
Cheers
JB
 
Consistency? It's a sort of "unwritten" standard that will be helpful if you
are writing things other developers accustomed to the framework use.
 
Thats what I thought.
Makes it interesting when I have to subclass eventargs for almost every
event (will need to put some thought into reusability for multiple events).

Cheers
JB
 
Back
Top