public DbInterface(string[] init) { InitializeComponent(); foreach (string comm in init) { CommandInput.Text = comm; Execute_Click(this, null); CommandInput.Clear(); } }
private void Execute_Click(object sender, EventArgs e) { CommandOutput.AppendText("\n>>>" + CommandInput.Text + "\n"); CommandOutput.AppendText(DbInterpretter.Execute(CommandInput.Text) + '\n'); CommandInput.Clear(); if (!DbInterpretter.isRunning) { Close(); } UpdateDbInfo(); }
private void SendInput(object sender, RoutedEventArgs e) { try { if (CommandInput.Text.ToString() == "q" && serverRunning) { _heartbeat.Stop(); serverRunning = false; StopServerBtn.IsEnabled = false; StartServerBtn.IsEnabled = true; } ServerConsole.StandardInput.WriteLine(CommandInput.Text); ConsoleText.Text += CommandInput.Text + "\r\n"; CommandInput.Clear(); } catch { } }
private void CommandInput_KeyDown(object sender, KeyEventArgs e) { if (e.Key != Key.Enter) { return; } if (CommandInput.Text.ToString() == "q" && serverRunning) { _heartbeat.Stop(); serverRunning = false; StopServerBtn.IsEnabled = false; StartServerBtn.IsEnabled = true; ServerConsole.StandardInput.WriteLine(CommandInput.Text); ConsoleText.Text += CommandInput.Text + "\r\n"; } CommandInput.Clear(); }
private void ExecuteCommand() { if (CommandInput.Text.Length == 0) { return; // prevent empty commands } if (CommandInput.Text.ToUpper().Equals("EXIT")) { Application.Current.Shutdown(); } else { listener.SendCommand(CommandInput.Text); } CommandLog.AppendText("> " + CommandInput.Text + "\r\n"); CommandInput.Clear(); }