Signalling a event handler when two particular events have occured
My dotnet application handles the following SystemEvents.
Systems.SessionSwitchEvents Reason : Lock and Unlock
Systems.OnPowerModeChanged Modes : Resume and Suspend
Network events
Now the Resume event triggers 3 events
unlock , resume and some network events ( some times it triggers multiple network events (up/down ) not stabilized)
Now i have a functionality which is all the same for all th开发者_StackOverflow中文版ese events which i have implemented in thier corresponding event handlers.
I want a sync when a resume event occurs.
basically want to signal the resume event handler when both unlock and network Up events have occured until then the Resume event handler should sleep.
IS there a way to signal my resume event handler when two events occur.
Thanks
It sounds like you need to count your events and block until they have all been triggered. A Countdown type would be appropriate. See this example Countdown event.
精彩评论