Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();

            OutputTextBox.TextChanged += (sender, e) => { OutputTextBox.ScrollToEnd(); };
            SqlTextBox.TextChanged    += (sender, e) => { SqlTextBox.ScrollToEnd(); };

            Database.TestFirebirdConnection();
        }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
 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();
     });
 }
Exemplo n.º 10
0
        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();
                }
            }
        }
Exemplo n.º 11
0
 private void OnOutputTextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
 {
     OutputTextBox.ScrollToEnd();
 }
Exemplo n.º 12
0
 /// <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();
 }
Exemplo n.º 14
0
 /// <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(); });
 }