public void Function() { var handle = new ManualResetEvent(false); var e = new PauseEventArgs(handle); Parser.RaisePause(Context, e); handle.WaitOne(); }
/// <summary> /// Raises the input prompt if in interactive mode. /// </summary> /// <param name="e">The input arguments.</param> internal void RaisePause(PauseEventArgs e) { if (InteractiveMode && PauseDemanded != null) { PauseDemanded(this, e); } else { e.Continue(); } }
/// <summary> /// Raises the input prompt if in interactive mode. /// </summary> /// <param name="sender">The sending context that demands the user input.</param> /// <param name="e">The input arguments.</param> public static void RaisePause(ParseContext sender, PauseEventArgs e) { if (InteractiveMode && OnPauseDemanded != null) { OnPauseDemanded(sender, e); } else { e.Continue(); } }
static void OnPauseDemanded(Object sender, PauseEventArgs e) { Console.WriteLine("Press any key to continue . . . "); Console.ReadKey(true); e.Continue(); }