Exemplo n.º 1
0
        /// <summary>
        /// Writes the output to the console control.
        /// </summary>
        /// <param name="output">The output.</param>
        /// <param name="color">The color.</param>
        public void WriteOutput(string output, Color color)
        {
            if (string.IsNullOrEmpty(_lastInput) == false &&
                (output == _lastInput || output.Replace("\r\n", "") == _lastInput))
            {
                return;
            }

            RunOnUiDespatcher(() =>
            {
                //  Write the output.
                RichTextBoxConsole.Selection.ApplyPropertyValue(TextBlock.ForegroundProperty, new SolidColorBrush(color));
                RichTextBoxConsole.AppendText(output);
                RichTextBoxConsole.ScrollToEnd();
            });
        }
Exemplo n.º 2
0
 private void logToWindow(string text)
 {
     RichTextBoxConsole.AppendText(($"{text} \n"));
     RichTextBoxConsole.ScrollToEnd();
 }