Пример #1
0
        public void ConsWrite(string s)
        {
            const int MaxConsSz = 500;

            Cons.AppendText(DateTime.Now.ToString("H:m:s  ") + s + "\n");
            if (Cons.Lines.Length > MaxConsSz)
            {
                int numOfLines = Cons.Lines.Length - MaxConsSz;
                var lines      = this.Cons.Lines;
                var newLines   = lines.Skip(numOfLines);
                this.Cons.Lines = newLines.ToArray();
            }
            Cons.SelectionStart = Cons.Text.Length;
            Cons.ScrollToCaret();
        }