public void StartPChat(string login) { if (OnlineUsers.IsPChating(login)) { this.ShowMessageAsync("Уведомление", "Чат с данным пользователем уже открыт!"); return; } PChatHelper.addChat(login); }
private void Send_but_Click(object sender, RoutedEventArgs e) { string Text = Box_mess.Text; if (Text != "") { PChatHelper.SendPMessage(Login, Text); addMess("Server : " + Text); Box_mess.Clear(); } }
public TMsg SendPMessage(TMsg msg) { if (msg.type == "PCancel") { if (OnlineUsers.IsPChating(msg.from)) { PChatHelper.closeChat(msg.from); MainWindowWorker.show_push(msg.from + " вышел из приватного чата.", "pmsg"); } } if (msg.type == "PRequest") { MainWindowWorker.Request_PChat(msg.from); } else { PChatHelper.ReceivePMessage(msg); } return(new TMsg("Server", msg.from, "Succes")); }
private void Window_Closing(object sender, CancelEventArgs e) { PChatHelper.removeChat(Login); }