public static void LogoutActions() { // Disable the "camera upload" service if is enabled if (MediaService.GetAutoCameraUploadStatus()) { LogService.Log(MLogLevel.LOG_LEVEL_INFO, "Disabling CAMERA UPLOADS service (LOGOUT)"); MediaService.SetAutoCameraUpload(false); } // Clear settings, cache, previews, thumbnails, etc. SettingsService.ClearSettings(); SettingsService.ClearMegaLoginData(); Deployment.Current.Dispatcher.BeginInvoke(() => { // Added extra checks preventing null reference exceptions if (App.MainPageViewModel == null) { return; } if (App.MainPageViewModel.CloudDrive != null) { App.MainPageViewModel.CloudDrive.ChildNodes.Clear(); } if (App.MainPageViewModel.RubbishBin != null) { App.MainPageViewModel.RubbishBin.ChildNodes.Clear(); } }); AppService.ClearAppCache(false); // Delete Account Details info AccountService.ClearAccountDetails(); }
/// <summary> /// Method that executes the actions needed for a logout /// </summary> public static void LogoutActions() { // Disable the "Camera Uploads" service if is enabled if (TaskService.IsBackGroundTaskActive(CameraUploadService.TaskEntryPoint, CameraUploadService.TaskName)) { LogService.Log(MLogLevel.LOG_LEVEL_INFO, "Disabling CAMERA UPLOADS service (LOGOUT)"); TaskService.UnregisterBackgroundTask(CameraUploadService.TaskEntryPoint, CameraUploadService.TaskName); } // Clear settings, offline, cache, previews, thumbnails, etc. SettingsService.ClearSettings(); SettingsService.RemoveSessionFromLocker(); ClearOfflineAsync(); ClearAppCacheAsync(true); // Clear all the account and user data info AccountService.ClearAccountDetails(); AccountService.ClearUserData(); // Clear all the contacts info ContactsService.Clear(); }