[c#] How to block until an event is fired in c#