This is a C# question I want to do a synchronous call for asynchronous event call backs. See comment in code for the req
class User
{
EventHandler Service1Started()
{
"Looks like service 1 started as I got event from server class" ;
}
EventHandler Service2Started()
{
"Looks like service 2 started as I got event from server class" ;
}
public void StartServicesOnlyStartService2AfterService1Started()
{
Server server = new Server();
// want to call these 2 methods synchronously here
// how to wait till service1 has started thru the event we get
// Want to avoid polling, sleeping etc if possible
server.StartService1();
server.StartService2();
}
}