private void readMsg() { ShowMsgDelegate msgdlg = new ShowMsgDelegate(showMsg); while (isMMruning) { string sysmsg = "", trademsg = ""; MessageManager.GetInstance().GetNewMessages(ref sysmsg, ref trademsg); this.BeginInvoke(msgdlg, sysmsg, trademsg); Thread.Sleep(1000); } }
public void ShowMsg(string msg) { if (richTextBox1.InvokeRequired) { ShowMsgDelegate d = ShowMsg; richTextBox1.Invoke(d, msg); } else { StringBuilder sb = new StringBuilder(); sb.Append(msg.ToString()); this.richTextBox1.AppendText(sb.ToString()); } }
public void ShowMessage(string msg) { ShowMsgDelegate d = new ShowMsgDelegate(ShowMsg); this.Dispatcher.BeginInvoke(d, msg); }
public LogHelper() { EvenShowMsgDelegate += show; InitializeComponent(); }