private void SetTextHTML(string text) { if (this.wbChat.InvokeRequired) { Form1.SetTextCallBack method = new Form1.SetTextCallBack(this.SetTextHTML); base.Invoke(method, new object[] { text }); } else { wbChat.Document.Write(text); } }
private void SetText(string text) { if (this.lbConfig.InvokeRequired) { Form1.SetTextCallBack method = new Form1.SetTextCallBack(this.SetText); base.Invoke(method, new object[] { text }); } else { string currentTime = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"); string loggedText = String.Format("[{0}]: {1}", currentTime, text); this.lbConfig.Items.Add(loggedText); lbConfig.SelectedIndex = lbConfig.Items.Count - 1; lbConfig.SelectedIndex = -1; } }