コード例 #1
0
        public async void ExportAll()
        {
            _exportAll = false;

            try
            {
                var exportFilePath = _persistenceService.GetFilePath("*.config", L(nameof(Resources.LocalSourceViewModel_ConfigFiles), "(.config)|*.config"));

                if (string.IsNullOrEmpty(exportFilePath))
                {
                    return;
                }

                await _chocolateyService.ExportPackages(exportFilePath, true);

                await _dialogService.ShowMessageAsync(
                    L(nameof(Resources.LocalSourceView_ButtonExport)),
                    L(nameof(Resources.LocalSourceViewModel_ExportComplete), exportFilePath))
                .ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Logger.Fatal("Export all has failed.", ex);
                throw;
            }
            finally
            {
                _exportAll = true;
            }
        }