Exemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     ChatForm chatForm = new ChatForm(true);
     chatForm.Show();
     chatForm.Focus();
     this.Hide();
 }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     TcpClient clientSocket = new TcpClient();
     try
     {
         clientSocket.Connect(address.Text, Int32.Parse(port.Text));
         UserInfo userInfo = new UserInfo(loginText.Text, clientSocket);
         ChatForm chatForm = new ChatForm(false, userInfo);
         chatForm.Show();
         this.Hide();
     }
     catch (ArgumentNullException ane)
     {
         MessageBox.Show("ArgumentNullException : {0}", ane.ToString());
     }
     catch (SocketException se)
     {
         MessageBox.Show("SocketException : {0}", se.Message);
     }
     catch (Exception se)
     {
         MessageBox.Show("Unexpected exception : {0}", se.ToString());
     }
 }
Exemplo n.º 3
0
 public ChatForm createChatForm(int rank, string username)
 {
     chatForm = new ChatForm(rank, username);
     setupViews();
     return(UIManager.Instance.chatForm);
 }
Exemplo n.º 4
0
 public ServerListener(TcpListener listener, ChatForm chatForm)
 {
     this.Listener = listener;
     this.chatForm = chatForm;
 }