public ReportViewerControl(AsyncAnnotationReportBuilder.AnnotationReport annotation_report) { InitializeComponent(); WizardDPs.SetPointOfInterest(this, "LibraryAnnotationReportViewer"); ButtonPrint.Icon = Icons.GetAppIcon(Icons.Printer); ButtonPrint.ToolTip = "Print this report"; ButtonPrint.Click += ButtonPrint_Click; ButtonToWord.Icon = Icons.GetAppIcon(Icons.AnnotationReportExportToWord); ButtonToWord.ToolTip = "Export to Word"; ButtonToWord.Click += ButtonToWord_Click; ButtonToPDF.Icon = Icons.GetAppIcon(Icons.AnnotationReportExportToPDF); ButtonToPDF.ToolTip = "Export to PDF"; ButtonToPDF.Click += ButtonToPDF_Click; #if INCLUDE_UNUSED ButtonCollapseClickOptions.Caption = "Collapse"; ButtonCollapseClickOptions.Click += ButtonCollapseClickOptions_Click; ButtonExpandClickOptions.Caption = "Expand"; ButtonExpandClickOptions.Click += ButtonExpandClickOptions_Click; #endif this.annotation_report = annotation_report; ObjDocumentViewer.Document = annotation_report.flow_document; }
protected virtual void Dispose(bool disposing) { Logging.Debug("ReportViewerControl::Dispose({0}) @{1}", disposing, dispose_count); WPFDoEvents.SafeExec(() => { // Get rid of managed resources ObjDocumentViewer.Document?.Blocks.Clear(); }, must_exec_in_UI_thread: true); WPFDoEvents.SafeExec(() => { ObjDocumentViewer.Document = null; annotation_report = null; }); ++dispose_count; }
protected virtual void Dispose(bool disposing) { Logging.Debug("ReportViewerControl::Dispose({0}) @{1}", disposing, dispose_count); try { WPFDoEvents.InvokeInUIThread(() => { // Get rid of managed resources ObjDocumentViewer.Document?.Blocks.Clear(); }, Dispatcher); ObjDocumentViewer.Document = null; annotation_report = null; } catch (Exception ex) { Logging.Error(ex); } ++dispose_count; }