Exemple #1
0
 private void connect_button_Click(object sender, EventArgs e)
 {
     if (false == mSocketManager.IsConnected())
     {
         mSocketManager.StartServerConnection();
         connect_button.Text = "Connected";
     }
     else
     {
         mSocketManager.EndServerConnection();
         connect_button.Text = "Connect";
     }
 }
        private void submit_user_button_Click(object sender, EventArgs e)
        {
            // Early return if we are not connected
            if (false == mSocketManager.IsConnected())
            {
                return;
            }

            if (password_text.Text != repassword_text.Text)
            {
                diagnostic_message_label.ForeColor = System.Drawing.Color.Red;
                //diagnostic_message_label.Text = "Passwords do not match.";
            }
            else
            {
                diagnostic_message_label.ForeColor = System.Drawing.Color.Black;
                //diagnostic_message_label.Text = "Submitting request...";

                CreateUserRequest msg = new CreateUserRequest()
                {
                    username = username_text.Text,
                    password = password_text.Text,
                };

                mSocketManager.DispatchMessage(msg);
            }
        }