public static IPdfReportData GeneratePdf(IPdfReportData sampleInstance) { new PdfReportDocument { PdfRptData = sampleInstance }.GeneratePdf(); return(sampleInstance); }
private void doDisplaySampleType(Type sampleType) { if (sampleType == null) { return; } Task.Factory.StartNew(() => { try { BrowserGuiData.IsBusy = true; BrowserGuiData.ControlVisibility = Visibility.Hidden; IPdfReportData rpt = null; resetInfo(); var performanceResult = Performance.RunActionMeasurePerformance(() => rpt = SamplesList.GeneratePdf(sampleType)); showResult(rpt, performanceResult); BrowserGuiData.IsBusy = false; BrowserGuiData.ControlVisibility = Visibility.Visible; } //catch (Exception ex) //{ // MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); //} finally { BrowserGuiData.IsBusy = false; } }); }
private void showPdf(IPdfReportData rpt) { if (rpt == null) { return; } DispatcherHelper.DispatchAction(() => _acroPdf.ShowPdf(rpt.FileName)); Task.Factory.StartNew(() => BrowserGuiData.PdfFilePath = rpt.FileName); }
private void showPerformanceResult(IPdfReportData rpt, Tuple <long, TimeSpan> performanceResult) { BrowserGuiData.ElapsedTime = performanceResult.Item2.ToString(); BrowserGuiData.MemoryUsage = performanceResult.Item1.FormatSize(); if (string.IsNullOrWhiteSpace(rpt.FileName)) { return; } BrowserGuiData.FileSize = new FileInfo(rpt.FileName).Length.FormatSize(); }
private void showResult(IPdfReportData rpt, Tuple <long, TimeSpan> performanceResult) { if (rpt == null) { return; } showPerformanceResult(rpt, performanceResult); BrowserGuiData.SelectedIPdfReportData = rpt; showPdf(rpt); showFilesList(); }
private void runSample(Type sample) { IPdfReportData rpt = null; var performanceResult = Performance.RunActionMeasurePerformance(() => rpt = SamplesList.GeneratePdf(sample)); if (rpt == null) { return; } DispatcherHelper.DispatchAction(() => BrowserGuiData.IntegrationTests.Add( new TestResultItem { TestName = sample.ToString().Split('.')[2], PdfFilePath = rpt.FileName, ElapsedTime = performanceResult.Item2.ToString(), FileSize = string.IsNullOrWhiteSpace(rpt.FileName) ? string.Empty : new FileInfo(rpt.FileName).Length.FormatSize(), MemoryUsage = performanceResult.Item1.FormatSize().ToString(CultureInfo.InvariantCulture) }) ); }
public static IPdfReportData GeneratePdf(IPdfReportData sampleInstance) { new PdfReportDocument { PdfRptData = sampleInstance }.GeneratePdf(); return sampleInstance; }
private void btnReportGen_Click(object sender, RoutedEventArgs e) { SARViewer.PDFCreator pdfCreator = new SARViewer.PDFCreator(); IPdfReportData data = pdfCreator.CreatePdfReport(studentData.StudentDirectory); }
private void showResult(IPdfReportData rpt, Tuple<long, TimeSpan> performanceResult) { if (rpt == null) return; showPerformanceResult(rpt, performanceResult); BrowserGuiData.SelectedIPdfReportData = rpt; showPdf(rpt); showFilesList(); }
private void showPerformanceResult(IPdfReportData rpt, Tuple<long, TimeSpan> performanceResult) { BrowserGuiData.ElapsedTime = performanceResult.Item2.ToString(); BrowserGuiData.MemoryUsage = performanceResult.Item1.FormatSize(); if (string.IsNullOrWhiteSpace(rpt.FileName)) return; BrowserGuiData.FileSize = new FileInfo(rpt.FileName).Length.FormatSize(); }
private void showPdf(IPdfReportData rpt) { if (rpt == null) return; DispatcherHelper.DispatchAction(() => _acroPdf.ShowPdf(rpt.FileName)); Task.Factory.StartNew(() => BrowserGuiData.PdfFilePath = rpt.FileName); }
private void doDisplayDynamicSampleInstance(IPdfReportData sampleInstance) { if (sampleInstance == null) return; Task.Factory.StartNew(() => { try { BrowserGuiData.IsBusy = true; BrowserGuiData.ControlVisibility = Visibility.Hidden; IPdfReportData rpt = null; resetInfo(); var performanceResult = Performance.RunActionMeasurePerformance(() => rpt = SamplesList.GeneratePdf(sampleInstance)); showResult(rpt, performanceResult); BrowserGuiData.IsBusy = false; BrowserGuiData.ControlVisibility = Visibility.Visible; } //catch (Exception ex) //{ // MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); //} finally { BrowserGuiData.IsBusy = false; } }); }