Esempio n. 1
0
        async void ExecuteExportBackupCommand()
        {
            try
            {
                var picker = new FileSavePicker();
                picker.DefaultFileExtension = ".json";
                picker.SuggestedFileName    = $"hohoema-backup-{DateTime.Today:yyyy-MM-dd}";
                picker.FileTypeChoices.Add("Hohoema backup File", new List <string>()
                {
                    ".json"
                });
                var file = await picker.PickSaveFileAsync();

                if (file != null)
                {
                    await _backupManager.BackupAsync(file, default);

                    _notificationService.ShowLiteInAppNotification_Success("バックアップを保存しました");
                }
            }
            catch (Exception e)
            {
                _logger.ZLogError(e, "Backup export failed");
            }
        }