public void OnEvent(object MapEvent) { FormPrintPreview dlg = new FormPrintPreview(); //PrintPreviewDialog dlg = new PrintPreviewDialog(); dlg.Document = PrinterPage.Document; PrinterMap map = new PrinterMap((Map)((MapEvent)MapEvent).Map); PrinterPage page = new PrinterPage(map, ((MapEvent)MapEvent).Map.Display.Envelope); //dlg.ShowDialog(); page.Release(); }
public Task <bool> OnEvent(object MapEvent) { FormPrintPreview dlg = new FormPrintPreview(); //PrintPreviewDialog dlg = new PrintPreviewDialog(); dlg.Document = PrinterPage.Document; PrinterMap map = new PrinterMap((Map)((MapEvent)MapEvent).Map); PrinterPage page = new PrinterPage(map, ((MapEvent)MapEvent).Map.Display.Envelope); //dlg.ShowDialog(); page.Release(); return(Task.FromResult(true)); }