Beispiel #1
0
        private void ExportAll()
        {
            var reportBuilder = new StringBuilder();

            var profiles = GetOptionsCollection();

            _optionTasks.ProfileExportProcessor.PrepareForExport(profiles, s => reportBuilder.AppendLine(s));

            var fileName = _uiService.ShowSaveDialog(Strings.Get($"Export profiles"));

            if (fileName != null)
            {
                _optionTasks.SaveOptions(profiles, fileName);
                reportBuilder.AppendLine(Strings.Get($"Sucessfully exported {profiles.Length} profile(s) to '{fileName}'."));
            }
            else
            {
                reportBuilder.AppendLine(Strings.Get($"Export cancelled by user."));
            }

            _uiService.ShowReport(Strings.Get($"Export profiles"), reportBuilder.ToString());
        }