I'm playing a little with the Microsoft Workflow Foundation, and needed a quick way to set a system-wide named event, to make an activity unblock and continue its processing. So I started with my own slimKEYS plug-in sample, and modified it to set a named EventWaitHandle when the handler's hotkey is pressed.
Now, within a CodeActivity's ExecuteCode event, I can make a very simple wait on the same name:
// Timeout management ignored for simplicity
EventWaitHandle eventHandle = new EventWaitHandle( false, EventResetMode.AutoReset, "FooBar" );
eventHandle.WaitOne();
You can find this new sample plug-in here.