Пример #1
0
 public void _client_Received(ClientSettings cs, string received)
 {
     var cmd = received.Split('|');
     switch (cmd[0])
     {
         case "Users":
             this.Invoke(() =>
             {
                 userList.Items.Clear();
                 for (int i = 1; i < cmd.Length; i++)
                 {
                     if (cmd[i] != "Connected" | cmd[i] != "RefreshChat")
                     {
                         userList.Items.Add(cmd[i]);
                     }
                 }
             });
             break;
         case "Message":
             this.Invoke(() =>
             {
                 txtReceive.Text += cmd[1] + "\r\n";
             });
             break;
         case "RefreshChat":
             this.Invoke(() =>
             {
                 txtReceive.Text = cmd[1];
             });
             break;
         case "Chat":
             this.Invoke(() =>
             {
                 pChat.Text = pChat.Text.Replace("user", formLogin.txtNickname.Text);
                 pChat.Show();
             });
             break;
         case "pMessage":
             this.Invoke(() =>
             {
                 pChat.txtReceive.Text += "Server says: " + cmd[1] + "\r\n";
             });
             break;
         case "Disconnect":
             Application.Exit();
             break;
     }
 }
Пример #2
0
 public LoginForm()
 {
     Client = new ClientSettings();
     InitializeComponent();
 }
Пример #3
0
 public LoginForm()
 {
     Client = new ClientSettings();
     InitializeComponent();
 }
Пример #4
0
 private static void Client_Disconnected(ClientSettings cs)
 {
 }
Пример #5
0
 private static void Client_Disconnected(ClientSettings cs)
 {
 }