Exemplo n.º 1
0
 void IPrintService.PreviewDocument(IPrintableDocument document)
 {
     IUIService service = (IUIService) this._serviceProvider.GetService(typeof(IUIService));
     PrintDocument document2 = document.CreatePrintDocument();
     document2.DefaultPageSettings = this.PageSettings;
     Microsoft.Matrix.Core.UserInterface.PrintPreviewDialog form = new Microsoft.Matrix.Core.UserInterface.PrintPreviewDialog(this._serviceProvider, document2);
     if (service != null)
     {
         service.ShowDialog(form);
     }
     else
     {
         form.ShowDialog();
     }
 }
Exemplo n.º 2
0
 void IPrintService.PrintDocument(IPrintableDocument document)
 {
     PrintDocument document2 = document.CreatePrintDocument();
     document2.DefaultPageSettings = this.PageSettings;
     PrintDialog dialog = new PrintDialog();
     dialog.Document = document2;
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         document2.Print();
     }
 }