protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); // Does this prevent windows from shutting down? if (e.CloseReason == CloseReason.WindowsShutDown) { return; } // Final Confirm user wants to close, if connected to ssh. if (ProcessInterface.IsProcessRunning) { switch (MessageBox.Show(this, "The server is still active!\n\nAre you sure you want to kill the server?\n\nPerforming this action will hard-stop the server, without allowing it too shutdown properly\n\nPlease click on the Cancel button below and use the shutdown command, before closing the application.\n\n*WARNING: AFTER CLICKING OK DATA LOSS MAY OCCUR*", "Active Server Exit Warning", MessageBoxButtons.OKCancel)) { case DialogResult.Cancel: e.Cancel = true; break; default: // Disables connection watcher, allowing thread to exit ProcessInterface.StopProcess(); exitingApplication = true; ACEManager.Log.AddLogLine("Exiting..."); break; } } else { ACEManager.Log.AddLogLine("Exiting..."); } }
private void BtnKill_Click(object sender, EventArgs e) { if (consoleControl1.IsProcessRunning) { EchoCommand("Killing process..."); ProcessInterface.StopProcess(); UpdateStatus(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _loaded = true; _cmd = new ProcessInterface(); _cmd.OnProcessOutput += cmd_OnProcessOutput; _cmd.OnProcessError += cmd_OnProcessOutput; _cmd.OnProcessExit += cmd_OnProcessExit; _cmd.StartProcess("cmd.exe", "/q /k shellloader.cmd"); }
public Console() { InDesignMode = LicenseManager.UsageMode == LicenseUsageMode.Designtime; IsLoading = true; InitializeComponent(); InitializeKeyMappings(); _writer = new BufferedWriter(FlushBuffer); _processInterface = new ProcessInterface(); _processInterface.Output += (_, args) => OnOutput(args); _processInterface.Error += (_, args) => OnError(args); }
public WebPageForm(String webPageTitle, Color gardientLeftColor, Color gardientRightColor, ADDON_TYPES[] addonTypes, ProcessInterface processObject, PAGE_PARSER_TYPES parserType) { InitializeComponent(); this.addonList = new List <AddonEntity>(); this.addonTypes = addonTypes; this.process = processObject; this.now = DateTime.Now; init(webPageTitle, gardientLeftColor, gardientRightColor); isWebParsing = false; this.parserType = parserType; this.DataContext = this; }
/// <summary> /// Starts the ACE Server process. /// </summary> public void StartServer() { processExited = false; if (!ProcessInterface.IsProcessRunning) { var result = ProcessInterface.StartProcessResult(Path.Combine(AceServerPath, AceServerExecutable), AceServerArguments, AceServerPath); if (result.Length > 0) { ProcessError(result); } else { EchoCommand("... Started!"); } } }
private void btnSendList_Click(object sender, EventArgs e) { if (lbProcesses.SelectedIndex == -1) { MessageBox.Show("There's no process selected"); return; } var pi = new ProcessInterface(lbProcesses.SelectedItem.ToString()); if (pi.Hooked) { WGH_Core.currentMemoryInterface = pi; this.DialogResult = DialogResult.OK; this.Close(); } else { this.Close(); } }
void processInterace_OnProcessOutput(object sender, ProcessInterface.ProcessEventArgs args) { // Write the output, in white WriteOutput(args.Content, Color.White); // Fire the output event. FireConsoleOutputEvent(args.Content); }
void processInterace_OnProcessInput(object sender, ProcessInterface.ProcessEventArgs args) { throw new NotImplementedException(); }
void processInterace_OnProcessExit(object sender, ProcessInterface.ProcessEventArgs args) { // Read only again. Invoke((Action)(() => { ConsoleText.ReadOnly = true; })); }
void processInterace_OnProcessExit(object sender, ProcessInterface.ProcessEventArgs args) { // Are we showing diagnostics? if (ShowDiagnostics) { this.color = Color.FromArgb(255, 0, 255, 0); WriteOutput( System.Environment.NewLine + processInterace.ProcessFileName + " exited." , Color.FromArgb(255, 0, 255, 0) ); } // Read only again. Invoke((Action)(() => { richTextBoxConsole.ReadOnly = true; })); }
void processInterace_OnProcessError(object sender, ProcessInterface.ProcessEventArgs args) { // Write the output, in red WriteLine(args.Content, Color.Red); // Fire the output event. FireConsoleOutputEvent(args.Content); }