/// <summary> /// Handles response from web service for creating user by redirecting user to the main screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Client_CreateUserCompleted(object sender, CreateUserCompletedEventArgs e) { if (e.Result == 0) { //display toast welcome message Toast.MakeText(this, "Account created!", ToastLength.Short).Show(); //if ok show the main screen and pass the username Intent main = new Intent(this, typeof(MainActivity)); main.PutExtra("Username", username.Text); StartActivity(main); Finish(); } //show error message if the username is already in use else if (e.Result == 1) { //display toast error message Toast.MakeText(this, "Username already taken. Please try again..", ToastLength.Long).Show(); } //display error message in case user account was not created else { //display toast error message Toast.MakeText(this, "Couldn't create account. Please try again..", ToastLength.Long).Show(); } }
void ShowCreateUserResult(object sender, CreateUserCompletedEventArgs e) { if (!e.Result.Success) { this.Error = e.Result.Error; } this.DialogResult = true; }
void CreateUserCompleted(object sender, CreateUserCompletedEventArgs e) { try { SetError("User successfully created. New User ID: " + e.Result); } catch (Exception ex) { ErrorMessage.FontSize = 8; ErrorMessage.TextWrapping = TextWrapping.Wrap; SetError("Error: " + ex.ToString()); } }