Beispiel #1
0
        public void AppendText(string text, Color color, bool bold) //Empty for use theme color
        {
            if (appendings.Count(_ => _.Text == text && _.Color == color && _.Bold == bold) == 0)
            {
                appendings.Add(Appending.Create(text, color, bold));
            }

            baseTextBox.SelectionStart  = baseTextBox.TextLength;
            baseTextBox.SelectionLength = 0;
            if (bold)
            {
                baseTextBox.SelectionFont = new Font(baseTextBox.Font, FontStyle.Bold);
            }
            else
            {
                baseTextBox.SelectionFont = new Font(baseTextBox.Font, FontStyle.Regular);
            }
            baseTextBox.SelectionColor = color == Color.Empty ? MetroPaint.ForeColor.Label.Normal(Theme) : color;
            baseTextBox.AppendText(text);
            baseTextBox.SelectionColor = baseTextBox.ForeColor;
        }