Пример #1
0
 public virtual void OnEventClientDisconnect(object source, ServerMessageEventArgs args)
 {
     SendMessageToServer(CommandDisconnect);
     serverConnection.CloseConnection();
     chatWindow.Close();
     chatWindow.parentForm.Show();
 }
Пример #2
0
 public virtual void OnEventClientRecieveMessage(ServerMessageEventArgs args)
 {
     if (EventClientRecieveMessage != null)
     {
         EventClientRecieveMessage(this, args);
     }
 }
Пример #3
0
 public virtual void OnEventClientConnect(ServerMessageEventArgs args)
 {
     if (EventClientConnect != null)
     {
         EventClientConnect(this, args);
     }
 }
Пример #4
0
 public virtual void OnEventClientRecieveMessage(object source, ServerMessageEventArgs args)
 {
     if (args.Message.StartsWith(CommandClientList))
     {
         chatWindow.Invoke(new Action <string>(chatWindow.FillClientList), args.Message.Substring(CommandClientList.Length).Trim());
     }
     else
     {
         chatWindow.Invoke(new Action <string>(chatWindow.ConcatinateChatTextBox), args.Message);
     }
     serverConnection.OnEventClientShowMessage(args);
 }
Пример #5
0
 public virtual void OnEventClientConnect(object source, ServerMessageEventArgs args)
 {
     //send to a list of clients***
     SendMessageToServer(CommandSetName + chatWindow.clientName);
 }
Пример #6
0
 public virtual void OnEvenClientSendMessage(object source, ServerMessageEventArgs args)
 {
     SendMessageToServer(args.Message);
 }
Пример #7
0
 private void OnEventClientShowMessage(object sender, ServerMessageEventArgs args)
 {
     chatTextBox.Text += args.Message;
 }