public void addMessageLogText(object sender, MessageEvent e) { if (this.InvokeRequired) { MessageEventCallDelegate ev = new MessageEventCallDelegate(addMessageLogText); this.BeginInvoke(ev, new object[] { sender, e }); } else { this.textBox1.AppendText(e.myTime.ToString() + " " + sender.ToString() + ": " + e.ToString() + "\r\n"); } }
public void addMessageLogText(object sender, MessageEvent e) { if (e.Verbosity > 0 && !this.softwareTimedTaskLogTextCheckbox.Checked) return; if (!formLoaded) return; if (showWarningsErrorsOnly.Checked && e.MessageType != MessageEvent.MessageTypes.Error && e.MessageType != MessageEvent.MessageTypes.Warning) return; /// This is a closure. Fancy functional makes the code cleaner. Action printMessage = () => eventLogTextBox.AppendText(e.MyTime.ToString() + " " + sender.ToString() + ": " + e.ToString() + "\r\n"); BeginInvoke(printMessage); }
public void addMessageLogText(object sender, MessageEvent e) { WordGenerator.MainClientForm.instance.handleMessageEvent(sender, e); if (this.InvokeRequired) { EventHandler<MessageEvent> ev = new EventHandler<MessageEvent>(addMessageLogText); this.BeginInvoke(ev, new object[] { sender, e }); } else { MessageEvent message = e as MessageEvent; if (message != null) { textBox1.AppendText(message.MyTime.ToString() + " " + sender.ToString() + ": " + message.ToString() + "\r\n"); } else { textBox1.AppendText(sender.ToString() + ": " + e.ToString() + "\r\n"); } } }
public void addMessageLogText(object sender, MessageEvent e) { Action addText = () => this.textBox1.AppendText(e.MyTime.ToString() + " " + sender.ToString() + ": " + e.ToString() + "\r\n"); BeginInvoke(addText); }
public void messageLog(object sender, MessageEvent message) { if (messageLogHandler != null) messageLogHandler(sender, message); }
public void handleMessageEvent(object sender, MessageEvent e) { addStatusText(sender, e); addMessageLogText(sender, e); }
public void addStatusText(object sender, MessageEvent e) { if (this.InvokeRequired) { this.BeginInvoke(new EventHandler<MessageEvent>(addStatusText), new object[] { sender, e }); } else { toolStripStatusLabel.Text = e.ToString(); } }
private static void safeMessageLog(MessageEvent message) { if (messageLog != null) messageLog(dummy, message); }
public void addMessageLogText(object sender, MessageEvent e) { if (this.InvokeRequired) { EventHandler<MessageEvent> ev = addMessageLogText; this.BeginInvoke(ev, new object[] { sender, e }); } else { WordGenerator.MainClientForm.instance.handleMessageEvent(sender, e); MessageEvent message = (MessageEvent)e; if (!this.IsDisposed) { this.textBox1.AppendText(message.MyTime.ToString() + " " + message.ToString() + "\r\n"); } } }