private void btnRegister_Click(object sender, RoutedEventArgs e) { string username = txtUsername.Text; StatusCode sc = client.SignUp(username, txtPassword.Password); if (sc == StatusCode.SUCCESS) { //Register succesful new LobbyWindow(username, txtPassword.Password).Show(); this.Close(); } else { MessageBox.Show(StatusCodeConverter.GetDescription(sc), "Error"); } }
private void btnLogin_Click(object sender, RoutedEventArgs e) { btnLogin.IsEnabled = false; string username = txtUsername.Text; StatusCode sc = client.Login(username, txtPassword.Password); if (sc == StatusCode.SUCCESS) { //Login succesful new LobbyWindow(username, txtPassword.Password).Show(); this.Close(); } else { MessageBox.Show(StatusCodeConverter.GetDescription(sc), "Error"); } btnLogin.IsEnabled = true; }