I think you should never use - = new EventHandler (anEvent), because the new event handler cannot yet be on the event delegate list. Need to do:
EventHandler eventHandler = new EventHandler(anEvent); anObject.Event += eventHandler; ... anObject.Event -= eventHandler;
Update
In fact, Ed is right, the delegate checks the target and method, not the handler object. Itβs a little late for me to find out, it makes a lot of lines, I wrote outdated ...
Remus Rusanu
source share