Example #1
0
 public static IPdfReportData GeneratePdf(IPdfReportData sampleInstance)
 {
     new PdfReportDocument {
         PdfRptData = sampleInstance
     }.GeneratePdf();
     return(sampleInstance);
 }
Example #2
0
 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;
         }
     });
 }
Example #3
0
 private void showPdf(IPdfReportData rpt)
 {
     if (rpt == null)
     {
         return;
     }
     DispatcherHelper.DispatchAction(() => _acroPdf.ShowPdf(rpt.FileName));
     Task.Factory.StartNew(() => BrowserGuiData.PdfFilePath = rpt.FileName);
 }
Example #4
0
 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();
 }
Example #5
0
        private void showResult(IPdfReportData rpt, Tuple <long, TimeSpan> performanceResult)
        {
            if (rpt == null)
            {
                return;
            }

            showPerformanceResult(rpt, performanceResult);
            BrowserGuiData.SelectedIPdfReportData = rpt;
            showPdf(rpt);
            showFilesList();
        }
Example #6
0
        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)
            })
                                            );
        }
Example #7
0
 public static IPdfReportData GeneratePdf(IPdfReportData sampleInstance)
 {
     new PdfReportDocument { PdfRptData = sampleInstance }.GeneratePdf();
     return sampleInstance;
 }
Example #8
0
 private void btnReportGen_Click(object sender, RoutedEventArgs e)
 {
     SARViewer.PDFCreator pdfCreator = new SARViewer.PDFCreator();
     IPdfReportData       data       = pdfCreator.CreatePdfReport(studentData.StudentDirectory);
 }
Example #9
0
        private void showResult(IPdfReportData rpt, Tuple<long, TimeSpan> performanceResult)
        {
            if (rpt == null)
                return;

            showPerformanceResult(rpt, performanceResult);
            BrowserGuiData.SelectedIPdfReportData = rpt;
            showPdf(rpt);
            showFilesList();
        }
Example #10
0
 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();
 }
Example #11
0
 private void showPdf(IPdfReportData rpt)
 {
     if (rpt == null) return;
     DispatcherHelper.DispatchAction(() => _acroPdf.ShowPdf(rpt.FileName));
     Task.Factory.StartNew(() => BrowserGuiData.PdfFilePath = rpt.FileName);
 }
Example #12
0
 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;
         }
     });
 }