/// <summary> /// Handles the OnProcessOutput event of the processInterace control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args">The <see cref="ProcessEventArgs"/> instance containing the event data.</param> void processInterace_OnProcessOutput(object sender, ProcessEventArgs args) { // Write the output, in white WriteOutput(args.Content); // Fire the output event. FireConsoleOutputEvent(args.Content); }
/// <summary> /// Handles the OnProcessExit event of the processInterace control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args">The <see cref="ProcessEventArgs"/> instance containing the event data.</param> void processInterace_OnProcessExit(object sender, ProcessEventArgs args) { try { if(!this.IsHandleCreated) return; // Are we showing diagnostics? if(ShowDiagnostics && !this._isDisposed) { WriteOutput(Environment.NewLine + processInterace.ProcessFileName + " exited.", Color.FromArgb(255, 0, 255, 0)); } if(this.InvokeRequired) { // Read only again. Invoke((Action)(() => { richTextBoxConsole.ReadOnly = true; })); } else { richTextBoxConsole.ReadOnly = true; } // trigger process exit. if(this.OnProcessExit != null) { this.OnProcessExit(this, new ConsoleEventArgs()); } } catch(Exception ex) { // if the window has been closed this blows up. } }
/// <summary> /// Handles the OnProcessInput event of the processInterace control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args">The <see cref="ProcessEventArgs"/> instance containing the event data.</param> void processInterace_OnProcessInput(object sender, ProcessEventArgs args) { }
/// <summary> /// Handles the OnProcessError event of the processInterace control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args">The <see cref="ProcessEventArgs"/> instance containing the event data.</param> void processInterace_OnProcessError(object sender, ProcessEventArgs args) { // Write the output, in red WriteOutput(args.Content, ErrorColor); // Fire the output event. FireConsoleOutputEvent(args.Content); }