private void OnNewMessage(Logger.Message message) { var item = new MessageItem(message); MessageItems.Enqueue(item); NewMessageItem?.Invoke(item); }
private void LogMessageChat_OnLogMessage(Logger.Message e) { if (this.InvokeRequired) { MethodInvoker inv = delegate { RichTextBoxExtensions.AppendText(this.richTextBox1, e.message + "\n", e.color); }; this.richTextBox1.BeginInvoke(inv); } else { RichTextBoxExtensions.AppendText(this.richTextBox1, e.message + "\n", e.color); } }
public MessageItem(Logger.Message message) { switch (message.Type) { case Logger.MessageType.Error: TextColor = "#721c24"; break; case Logger.MessageType.Info: TextColor = null; break; case Logger.MessageType.Warning: TextColor = "#856404"; break; } ; Text = message.Value; }