private void OnSendEmailCompleted(InvokeOperation operation) { x_OK.IsEnabled = true; string errorStatus = operation.CheckErrorStatus(); if (errorStatus != null) { x_ErrorStatus.Text = errorStatus; return; } x_ErrorStatus.Text = null; DialogResult = MessageBoxResult.OK; }
private void OnValidateResetPasswordCompleted(InvokeOperation<string> operation) { string errorStatus = operation.CheckErrorStatus(); string userName = (errorStatus != null ? null : operation.Value); if (userName != null) { AuthenticationDialog dialog = new AuthenticationDialog(AuthenticationDialog.DialogType.ResetPassword); dialog.ResetUserName = userName; dialog.ResetPasswordCode = m_ResetPasswordCode; } else { AuthenticationDialog dialog = new AuthenticationDialog(AuthenticationDialog.DialogType.RecoverSignIn); dialog.RecoverErrorStatus = "Sorry but the link you clicked on is no longer valid. Enter your email address again and we will send you a new recovery email."; } }
private void OnDeleteCompleted(InvokeOperation<bool> operation) { x_Delete.IsEnabled = true; string errorStatus = operation.CheckErrorStatus(); bool deleted = (errorStatus == null && operation.Value == true); if (!deleted) { x_DeleteErrorStatus.Text = (errorStatus != null ? errorStatus : g_AccountNotDeleted); x_DeleteErrorStatus.Visibility = Visibility.Visible; return; } App.Model.UserServices.Logout(null, null); x_DeleteErrorStatus.Text = null; x_DeleteErrorStatus.Visibility = Visibility.Collapsed; DialogResult = (deleted ? MessageBoxResult.OK : MessageBoxResult.Cancel); }
private void OnChangePasswordCompleted(InvokeOperation<bool> operation) { x_Change.IsEnabled = true; string errorStatus = operation.CheckErrorStatus(); bool changed = (errorStatus == null && operation.Value == true); if (!changed) { x_ChangeErrorStatus.Text = (errorStatus != null ? errorStatus : g_PasswordNotChanged); x_ChangeErrorStatus.Visibility = Visibility.Visible; return; } x_ChangeErrorStatus.Text = null; x_ChangeErrorStatus.Visibility = Visibility.Collapsed; x_ChangeCurrentPassword.Password = ""; x_ChangeNewPassword.Password = ""; DialogResult = (changed ? MessageBoxResult.OK : MessageBoxResult.Cancel); }
private void OnResetPasswordCompleted(InvokeOperation<bool> operation) { x_Reset.IsEnabled = true; string errorStatus = operation.CheckErrorStatus(); if (errorStatus != null) { x_ResetErrorStatus.Text = errorStatus; x_ResetErrorStatus.Visibility = Visibility.Visible; return; } App.Model.UserServices.Login(ResetUserName, ResetPassword, true/*isPersistent*/, OnResetPasswordCompletedStep2, null/*userState*/); x_ResetErrorStatus.Text = null; x_ResetErrorStatus.Visibility = Visibility.Collapsed; DialogResult = MessageBoxResult.OK; }
private void OnRecoverCompleted(InvokeOperation operation) { x_Recover.IsEnabled = true; string errorStatus = operation.CheckErrorStatus(); if (errorStatus != null) { x_RecoverErrorStatus.Text = errorStatus; x_RecoverErrorStatus.Visibility = Visibility.Visible; return; } x_RecoverErrorStatus.Text = null; x_RecoverErrorStatus.Visibility = Visibility.Collapsed; base.Closed += OnRecoverDialogClosed; DialogResult = MessageBoxResult.OK; }
private void OnRegisterCompletedStep4(InvokeOperation operation) { string errorStatus = operation.CheckErrorStatus(); if (errorStatus != null) { MessageBoxEx.ShowError("Register account", errorStatus, null); return; } }
private void OnDeleteUserCompleted(InvokeOperation<bool> operation) { x_Signin.IsEnabled = true; string errorStatus = operation.CheckErrorStatus(); bool deleted = (errorStatus == null && operation.Value == true); x_SignInErrorStatus.Text = string.Format("User account '{0}' was{1} deleted", SignInUserName, (deleted ? "" : " NOT")); x_SignInErrorStatus.Visibility = Visibility.Visible; }