private void ClickIconChat(object sender, EventArgs e) { string message = TextBoxChat.Text; if (!string.IsNullOrEmpty(message)) { serverChat.SendMessage(GameId, message); string format = "\n" + Properties.Resources.You + ": " + message; ChatBox.AppendText(format); ChatBox.ScrollToEnd(); TextBoxChat.Clear(); } }
private void buttonTest_Click(object sender, EventArgs e) { InstanceContext context = new InstanceContext(new MyCallback()); Proxy.ChatServiceClient server = new Proxy.ChatServiceClient(context); var message = TextBoxChat.Text; if (!string.IsNullOrEmpty(message)) { server.SendMessage(message); } LabelTextChat.Content += "\n " + "Tu : " + message; TextBoxChat.Clear(); }
private void ClickIconChat(object sender, EventArgs e) { string message = TextBoxChat.Text; if (!string.IsNullOrEmpty(message)) { try { server.SendMessage(0, message); string format = "\n" + Properties.Resources.You + ": " + message; ChatBox.AppendText(format); ChatBox.ScrollToEnd(); TextBoxChat.Clear(); } catch (CommunicationObjectFaultedException ex) { Console.WriteLine(ex.ToString()); LabelAlert.Content = Properties.Resources.ServerIsOff; } } }