Exemplo n.º 1
0
        private void OutputRunInfo(RichTextBoxEx richTextBox, string text, FrmMakeTake.eOutputType outputType = FrmMakeTake.eOutputType.Normal)
        {
            base.Invoke(new System.EventHandler(delegate
            {
                if (richTextBox.TextLength > 100000)
                {
                    richTextBox.Clear();
                }
                text = string.Format("{0}  {1}", System.DateTime.Now.ToString("HH:mm:ss"), text);
                richTextBox.SelectionStart = richTextBox.TextLength;
                switch (outputType)
                {
                case FrmMakeTake.eOutputType.Normal:
                    richTextBox.SelectionColor = System.Drawing.ColorTranslator.FromHtml("#BD86FA");
                    break;

                case FrmMakeTake.eOutputType.Important:
                    richTextBox.SelectionColor = System.Drawing.ColorTranslator.FromHtml("#A50081");
                    break;

                case FrmMakeTake.eOutputType.Warn:
                    richTextBox.SelectionColor = System.Drawing.ColorTranslator.FromHtml("#F9C916");
                    break;

                case FrmMakeTake.eOutputType.Error:
                    richTextBox.SelectionColor = System.Drawing.ColorTranslator.FromHtml("#DB2606");
                    break;

                default:
                    richTextBox.SelectionColor = System.Drawing.Color.White;
                    break;
                }
                richTextBox.AppendText(string.Format("{0}\r", text));
                richTextBox.ScrollToCaret();
            }));
        }
Exemplo n.º 2
0
 private void ShowMessage(string info, FrmMakeTake.eOutputType outputType)
 {
     this.OutputRunInfo(this.rtxtOutputInfo, info, outputType);
 }