private void HandleError(AccountCreationErrorType errorType) { switch (errorType) { case AccountCreationErrorType.UsernameExists: usernameEditText.Error = "Username already exists"; break; case AccountCreationErrorType.EmailExists: emailEditText.Error = "Email already exists"; break; case AccountCreationErrorType.ServerError: _dialogHelper.ShowError(this); break; case AccountCreationErrorType.Other: Toast.MakeText(BaseContext, "Some of the information you entered is incorrect", ToastLength.Short); break; } }
public static AccountCreationResultDto Failed(AccountCreationErrorType errorType) => new AccountCreationResultDto() { ErrorType = errorType, Succeeded = false };