Esempio n. 1
0
 void Output(string msg)
 {
     this.Dispatcher.Invoke(new Action(() =>
     {
         ConsoleText.AppendText(msg);
         ConsoleText.AppendText(Environment.NewLine);
     }));
 }
 // Writes out to console. It doesn't set it completely, but appends to the end of the last message.
 public void SetConsoleText(string s)
 {
     if (InvokeRequired)
     {
         Invoke(new Action <string>(SetConsoleText), new object[] { s });
         return;
     }
     ConsoleText.AppendText($"{s}\r\n");
 }
        private void DisplayUpdateHandler()
        {
            while (displayUpdateThread != null)
            {
                lock (displayBufferLocker)
                {
                    if (displayBuffer.Length > 0)
                    {
                        displayBuffer.Seek(0, SeekOrigin.Begin);
                        this.SafeInvoke(() =>
                        {
                            ConsoleText.AppendText(FilterText(displayBufferReader.ReadToEnd()));
                            ConsoleText.ScrollToCaret();
                        });
                        displayBuffer.SetLength(0);
                        UpdateConnString(this.latestActiveInterface);
                    }
                }

                Thread.Sleep(100);
            }
        }
 public void ACText(string s)
 {
     ConsoleText.AppendText(s);
 }