예제 #1
0
        public async Task <OperationResult> RestoreBackup()
        {
            var result = await backupManager.RestoreBackup();

            if (result.Success)
            {
                settingsFacade.LastDatabaseUpdate = DateTime.Now;
            }

            return(result);
        }
예제 #2
0
        private async void RestoreBackup()
        {
            if (!await ShowOverwriteDataInfo())
            {
                return;
            }

            dialogService.ShowLoadingDialog();
            await backupManager.RestoreBackup();

            dialogService.HideLoadingDialog();
            await ShowCompletionNote();
        }
예제 #3
0
        private async void RestoreBackup()
        {
            if (!await ShowOverwriteDataInfo())
            {
                return;
            }

            IsLoading = true;
            await backupManager.RestoreBackup();

            await ShowCompletionNote();

            IsLoading = false;
        }
예제 #4
0
        private async void RestoreBackup()
        {
            if (!await ShowOverwriteDataInfo())
            {
                return;
            }

            try
            {
                dialogService.ShowLoadingDialog();
                await backupManager.RestoreBackup();

                dialogService.HideLoadingDialog();
                await ShowCompletionNote();
            }
            catch (Exception)
            {
                await dialogService.ShowMessage(Strings.SomethingWentWrongTitle, Strings.ErrorMessageRestore);
            }
        }
예제 #5
0
        /// <summary>
        ///     Restores the backup from OneDrive when the backup is newer then the last modification.
        /// </summary>
        public async Task RestoreBackupIfNewer()
        {
            try {
                globalBusyIndicatorState.IsActive = true;
                if (!SettingsHelper.IsBackupAutouploadEnabled)
                {
                    globalBusyIndicatorState.IsActive = false;
                    return;
                }

                var backupDate = await backupManager.GetBackupDate();

                if (backupDate > SettingsHelper.LastDatabaseUpdate)
                {
                    await backupManager.RestoreBackup();
                }
            }
            catch (OneDriveException ex) {
                Mvx.Trace(MvxTraceLevel.Error, ex.Message);
            }
            globalBusyIndicatorState.IsActive = false;
        }
예제 #6
0
        public async Task RestoreBackup()
        {
            await backupManager.RestoreBackup();

            settingsFacade.LastDatabaseUpdate = DateTime.Now;
        }