using event and delegate

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

Is it any disadvantage to use the predefined delegate EventHandler instead
of declaring a new delegate if I'm satisfied with the signature of the
predefined one ?
If I want to pass some event data I just derive from EventArgs.

According to me is the only disadvantage that I have to downcast the second
parameter which is derived from EventArgs.

//Tony
 
Well, you could use EventHandler<T>, although in reality it is more
common to simply declare a delegate/args pair to suit.

Marc
 

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

Back
Top