예제 #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);
            }
        }
예제 #2
0
 private void addMessageLine(MessageFormater messageFormater)
 {
     listBoxMessages.SelectionColor = messageFormater.MessageColor;
     listBoxMessages.AppendText(messageFormater.Format());
 }