private void HideWindow(MessageWindow window) { if (this.InvokeRequired) { window.Invoke(new HideWindowCallback(HideWindow), window); } else { window.Hide(); } }
public void SetMessage(MessageWindow messageWindow, Commons.Message message) { if (messageWindow.InvokeRequired) { SetMessageCallback callback = new SetMessageCallback(messageWindow.RecievedNewMessage); messageWindow.Invoke(callback, message.Text, message.Sender.UserName); } else { messageWindow.RecievedNewMessage(message.Text, message.Sender.UserName); } }
private void ShowWindow(MessageWindow window) { if (window.InvokeRequired) { window.Invoke(new ShowWindowCallback(ShowWindow), window); } else { window.Show(); } }