This is a general answer and reflects the default behavior:
- Yes, it blocks the thread, if the methods subscribing to the event are not asynchronous.
- They are executed one after the other. This has another twist: If one event handler throws an exception, the event handlers not yet executed will not be executed.
Having said that, every class that provides events can choose to implement its event asynchronously. IDesign provides a class called EventsHelper
that simplifies this.
[Note] this link requires you to provide an e-mail address to download EventsHelper class. (I am not affiliated in any way)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…