Delegate parameters

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
 
K

Klaus H. Probst

Consistency? It's a sort of "unwritten" standard that will be helpful if you
are writing things other developers accustomed to the framework use.
 
J

John Baro

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top