Exemplo n.º 1
0
 private void localDisplayData(CommonClass.MessageType type, string msg)
 {
     if (this.LineCount > this.MAX_LINE)
     {
         this._displayWindow.Clear();
         this.LineCount = 0;
     }
     if (type == CommonClass.MessageType.Matching)
     {
         this._displayWindow.SelectionFont = new Font(this._displayWindow.SelectionFont, FontStyle.Bold);
     }
     else
     {
         this._displayWindow.SelectionFont = new Font(this._displayWindow.SelectionFont, FontStyle.Regular);
     }
     this._displayWindow.SelectionColor = CommonClass.MessageColor[(int)type];
     this._displayWindow.AppendText(msg);
     if (!msg.Contains("\r\n"))
     {
         this._displayWindow.AppendText("\r\n");
     }
     this._displayWindow.ScrollToBottom();
 }
Exemplo n.º 2
0
        public void DisplayData(CommonClass.MessageType type, string msg)
        {
            EventHandler method = null;

            try
            {
                if (((this._displayWindow != null) && !this._viewPause) && !this._displayWindow.IsDisposed)
                {
                    if (this._displayWindow != null)
                    {
                        if (this._displayWindow.InvokeRequired)
                        {
                            if (method == null)
                            {
                                method = delegate {
                                    this.localDisplayData(type, msg);
                                };
                            }
                            this._displayWindow.BeginInvoke(method);
                        }
                        else
                        {
                            this.localDisplayData(type, msg);
                        }
                    }
                    else
                    {
                        MessageBox.Show("CommonUtilsClass: DisplayData() _displayWindow is null", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error: " + exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }