public void WriteLine(string line, params object[] arguments) { //Check if the application is shutting down to prevent timed invokes on the output text from piling up if (ShuttingDown) { return; } line = string.Format(line, arguments); line = string.Format("{0} {1}", Nil.Time.Timestamp(), line); if (IsFirstLine) { IsFirstLine = false; } else { line = "\n" + line; } var action = (Action) delegate { lock (OutputTextBox) { OutputTextBox.AppendText(line); OutputTextBox.ScrollToEnd(); } }; OutputTextBox.Dispatcher.Invoke(action); }
private void OnOutputTextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) { if (OutputTextBox.VerticalOffset == 0.0f && OutputTextBox.ViewportHeight >= OutputTextBox.ExtentHeight || OutputTextBox.VerticalOffset + OutputTextBox.ViewportHeight == OutputTextBox.ExtentHeight) { OutputTextBox.ScrollToEnd(); } }
private void WriteShell(string outShell) { _vm.AddOutput(outShell); Dispatcher.Invoke(() => { OutputTextBox.ScrollToEnd(); }); }
private void InputTextBox_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { e.Handled = true; OutputTextBox.ScrollToEnd(); InputTextBox.Clear(); } }
public MainWindow() { InitializeComponent(); OutputTextBox.TextChanged += (sender, e) => { OutputTextBox.ScrollToEnd(); }; SqlTextBox.TextChanged += (sender, e) => { SqlTextBox.ScrollToEnd(); }; Database.TestFirebirdConnection(); }
private void RunFullDone(object sender, RunWorkerCompletedEventArgs e) { Settings.Running = false; ErrorTextBox.Text = Interpret.Output.RunFullErrorOutput; OutputTextBox.Text = Interpret.Output.RunFullOutput; OutputTextBox.ScrollToEnd(); Interpret.UpdateRegisterUI(); SetRunToReset(); SetOptionsToOptions(); }
void OutputTextBox_TextChanged(object sender, TextChangedEventArgs e) { int textMaxLength = 1000; if (OutputTextBox.Text.Length > textMaxLength) { OutputTextBox.Text = OutputTextBox.Text.Substring(OutputTextBox.Text.Length - textMaxLength); } OutputTextBox.ScrollToEnd(); }
private void RunFullUpdateDone(object sender, RunWorkerCompletedEventArgs e) { if (Settings.Running) { ErrorTextBox.Text = Interpret.Output.RunFullErrorOutput; OutputTextBox.Text = Interpret.Output.RunFullOutput; OutputTextBox.ScrollToEnd(); Interpret.UpdateRegisterUI(); RunFullUpdate.RunWorkerAsync(); } }
private void WriteOutput(string outShell) { if (!outShell.EndsWith("\n")) { outShell += "\n"; } Dispatcher.Invoke(() => { OutputTextBox.AppendText(outShell); OutputTextBox.ScrollToEnd(); }); }
private void CompositionTarget_Rendering(object sender, EventArgs e) { StringBuilder messages = new StringBuilder(); while (listener.Messages.TryTake(out string message)) { messages.Append(message); } if (messages.Length > 0) { OutputTextBox.Text += messages.ToString(); if (AutoScrollCheckBox.IsChecked ?? false) { OutputTextBox.ScrollToEnd(); } } }
private void OnOutputTextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) { OutputTextBox.ScrollToEnd(); }
/// <summary> /// Automatic scrolling window to bottom /// </summary> /// <param name="sender">Not used</param> /// <param name="e">Not used</param> private void OnOutputTextChanged(object sender, EventArgs e) { OutputTextBox.ScrollToEnd(); }
public void Log(string line) { OutputTextBox.Text += $"{line}\n"; OutputTextBox.ScrollToEnd(); }
/// <summary> /// Logs a line to the GUI. /// </summary> /// <param name="msg">The message to log.</param> private void LogLine(string msg) { OutputTextBox.Dispatcher.Invoke(() => { OutputTextBox.AppendText(msg + "\n"); OutputTextBox.ScrollToEnd(); }); }