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.
 
Back
Top