event add remove

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Why must I define a remove acessor for an event when I just want to process
the add, like to add logging or to verify that a subscriber could indeed
subscribe to the said event.
 
Because in the process of the add you are required to handle the event add,
likewise you must handle the removal. The compiler isn't capable of
understanding how you add the event in any way that would allow it to
generate removal code.
 

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