/// <summary> /// Close the dialog /// </summary> protected override async void CloseDialog(object obj = null) { base.CloseDialog(); if (this.recoveryKeySaved) { await new CustomMessageDialog( AppMessages.AM_RecoveryKeyCopied_Title, AppMessages.AM_RecoveryKeyCopied, App.AppInformation, MessageDialogButtons.Ok).ShowDialogAsync(); } if (this.atLogout) { var passwordReminderDialogListener = new SetPasswordReminderDialogResultListenerAsync(); // If user has checked the "Don't show me again" box if (!this.isTestPasswordSelected && this.doNotShowMeAgainCheckBox.IsChecked == true) { await passwordReminderDialogListener.ExecuteAsync(() => SdkService.MegaSdk.passwordReminderDialogBlocked(passwordReminderDialogListener)); } // If the user has checked the password successfully else if (this.passwordChecked) { await passwordReminderDialogListener.ExecuteAsync(() => SdkService.MegaSdk.passwordReminderDialogSucceeded(passwordReminderDialogListener)); } else { await passwordReminderDialogListener.ExecuteAsync(() => SdkService.MegaSdk.passwordReminderDialogSkipped(passwordReminderDialogListener)); // Only log out if the user has saved the recovery key if (!this.recoveryKeySaved) { return; } } SdkService.MegaSdk.logout(new LogOutRequestListener()); return; } // If user has checked the "Don't show me again" box if (!this.isTestPasswordSelected && this.doNotShowMeAgainCheckBox.IsChecked == true) { SdkService.MegaSdk.passwordReminderDialogBlocked(); } // If the user has checked the password successfully else if (this.passwordChecked) { SdkService.MegaSdk.passwordReminderDialogSucceeded(); } else { SdkService.MegaSdk.passwordReminderDialogSkipped(); } }
/// <summary> /// Event invocator method called when the user closes the dialog using /// the close button of the top-right corner of the dialog. /// </summary> protected override async void OnCloseButtonTapped() { base.OnCloseButtonTapped(); if (this.AtLogout) { var passwordReminderDialogListener = new SetPasswordReminderDialogResultListenerAsync(); // If user has checked the "Don't show me again" box if (!this.IsTestPasswordSelected && this.DoNotShowAgain) { await passwordReminderDialogListener.ExecuteAsync(() => SdkService.MegaSdk.passwordReminderDialogBlocked(passwordReminderDialogListener)); } // If the user has checked the password successfully else if (this.passwordChecked) { await passwordReminderDialogListener.ExecuteAsync(() => SdkService.MegaSdk.passwordReminderDialogSucceeded(passwordReminderDialogListener)); } else { await passwordReminderDialogListener.ExecuteAsync(() => SdkService.MegaSdk.passwordReminderDialogSkipped(passwordReminderDialogListener)); // Only log out if the user has saved the recovery key if (!this.recoveryKeySaved) { return; } } SdkService.MegaSdk.logout(new LogOutRequestListener()); return; } // If user has checked the "Don't show me again" box if (!this.IsTestPasswordSelected && this.DoNotShowAgain) { SdkService.MegaSdk.passwordReminderDialogBlocked(); } // If the user has checked the password successfully else if (this.passwordChecked) { SdkService.MegaSdk.passwordReminderDialogSucceeded(); } else { SdkService.MegaSdk.passwordReminderDialogSkipped(); } }