Example #1
0
        protected void MessageHandler(MessageFormater messageFormater)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MessageHandlerDel(MessageHandler), new object[] {messageFormater});
            }
            else
            {
                listBoxMessages.SuspendLayout();

                addMessageLine(messageFormater);

                if (listBoxMessages.Lines.Length > 5000)
                {
                    removeFirstFromListBox();
                }

                scrollToEndOfListBox();

                listBoxMessages.ResumeLayout(true);
            }
        }
Example #2
0
 private void addMessageLine(MessageFormater messageFormater)
 {
     listBoxMessages.SelectionColor = messageFormater.MessageColor;
     listBoxMessages.AppendText(messageFormater.Format());
 }