As a general rule, are there ever any circumstances in which it’s acceptable for a method responsible for listening to an event to throw an exception (or allow to be thrown) that the class raising the event will have to handle?
Given that such an exception would stop other listeners to that event from being called subsequently, it seems a bit ‘antisocial’ to allow this to happen, but on the other hand, if there is an exception, what should it do?
Throwing an exception from a event handler is in many ways similar to throwing an exception from a
IDisposable.Disposemethod (or a C++ destructor). Doing so creates havoc for your caller because you leave them with little option.Of all of these #4 is the best option. But this is rarely done and can’t be counted on.
I think in your component you really only have a few options