Пример #1
0
        /// <summary>
        /// Thread safe method to write to messages box. By default messages aren't errors.
        /// </summary>
        /// <param name="text">Message to output.</param>
        /// <param name="isError">If true, background colour of message is set to red and text is set to bold.</param>
        private void WriteMessage(string text, bool isError = false)
        {
            if (this.MessagesBox.InvokeRequired)
            {
                CallbackDelegateMessageBox d = new CallbackDelegateMessageBox(WriteMessage);
                this.Invoke(d, new object[] { text, isError });
            }
            else
            {
                ListViewItem L = new ListViewItem(text);

                if (isError)
                {
                    L.BackColor = Color.OrangeRed;
                    L.Font = new Font(L.Font, FontStyle.Bold);
                }
                MessagesBox.Items.Insert(0, L);
            }
        }
Пример #2
0
        /// <summary>
        /// Thread safe method to write to messages box. By default messages aren't errors.
        /// </summary>
        /// <param name="text">Message to output.</param>
        /// <param name="isError">If true, background colour of message is set to red and text is set to bold.</param>
        private void WriteMessage(string text, bool isError = false)
        {
            if (this.MessagesBox.InvokeRequired)
            {
                CallbackDelegateMessageBox d = new CallbackDelegateMessageBox(WriteMessage);
                this.Invoke(d, new object[] { text, isError });
            }
            else
            {
                ListViewItem L = new ListViewItem(text);

                if (isError)
                {
                    L.BackColor = Color.OrangeRed;
                    L.Font      = new Font(L.Font, FontStyle.Bold);
                }
                MessagesBox.Items.Insert(0, L);
            }
        }