Esempio n. 1
0
        /// <summary> Appends the log. </summary>
        /// <param name="text">The text to log.</param>
        public void AppendLog(string text, Color foreColor, bool dateStamp)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker)(() => AppendLog(text, foreColor, dateStamp)));
                return;
            }
            if (dateStamp)
            {
                Append(CurrentDate, Color.Gray);
            }
            int line = GetLineFromCharIndex(Math.Max(0, TextLength - 1));

            if (!Colorize)
            {
                AppendText(text);
                if (AutoScroll)
                {
                    ScrollToEnd(line);
                }
                return;
            }
            LineFormatter.Format(text, (c, s) => LineFormatter.FormatGui(c, s, this, foreColor));
            if (AutoScroll)
            {
                ScrollToEnd(line);
            }
        }