private void GeneratePdf() { string filePath = _savingFilePathSelector.GetFilePath(string.Format("{0} {1} - {2}", Date.Months[12 - Listing.Month], Listing.Year, Listing.Name), PrepareDialog); if (string.IsNullOrEmpty(filePath)) { return; } ProgressBarWindowViewModel pb = new ProgressBarWindowViewModel() { Text = "Vytváří se Váš PDF dokument..." }; Task.Run(async() => { Document doc = _listingPdfDocumentFactory.Create(Listing, _pdfSetting); _listingReportGenerator.Save(filePath, doc); pb.Success = true; await Task.Delay(pb.ResultIconDelay); pb.TryClose(); }); _windowManager.ShowDialog(pb); }
private void GeneratePdfs() { string filePath = _savingFilePathSelector.GetFilePath( string.Format("Výčetky {0}", SelectedYear), obj => { SaveFileDialog d = (SaveFileDialog)obj; d.Filter = "PDF dokument (*.pdf)|*.pdf"; } ); if (string.IsNullOrEmpty(filePath)) { return; } ProgressBarWindowViewModel pb = new ProgressBarWindowViewModel(); Task.Run(async() => { List <Listing> list = new List <Listing>(); for (int month = 0; month < 12; month++) { list.Add(new Listing(SelectedYear, month + 1)); } Document doc = _multipleListingReportFactory.Create(list, new DefaultListingPdfReportSetting()); _listingReportGenerator.Save(filePath, doc); pb.Success = true; await Task.Delay(pb.ResultIconDelay); pb.TryClose(); }); _windowManager.ShowDialog(pb); }
private void CreateBackup() { DateTime now = DateTime.Now; string filePath = _savingFilePathSelector.GetFilePath( string.Format("Záloha dat - {0}-{1}-{2}", now.Day, now.Month, now.Year), obj => { SaveFileDialog d = (SaveFileDialog)obj; d.Filter = "Evidoo data (*.evdo)|*.evdo"; } ); if (string.IsNullOrEmpty(filePath)) { return; } ProgressBarWindowViewModel pb = new ProgressBarWindowViewModel(); Task.Run(async() => { _settingFacade.BackupData(filePath); pb.Success = true; await Task.Delay(pb.ResultIconDelay); pb.TryClose(); }); _windowManager.ShowDialog(pb); }