Пример #1
0
        private bool Print(bool showPrintDialog, ScintillaPrintDocument doc)
        {
            if (showPrintDialog)
            {
                var pd = new PrintDialog();
                pd.Document = doc;
                pd.UseEXDialog = true;
                pd.AllowCurrentPage = true;
                pd.AllowSelection = true;
                pd.AllowSomePages = true;
                pd.PrinterSettings = doc.DefaultPageSettings.PrinterSettings;

                if (pd.ShowDialog(WB.Form) == DialogResult.OK)
                {
                    doc.PrinterSettings = pd.PrinterSettings;
                    doc.Print();
                    return true;
                }

                return false;
            }

            doc.Print();
            return true;
        }
Пример #2
0
 public DialogResult PrintPreview(ScintillaPrintDocument doc)
 {
     var ppd = new PrintPreviewDialog();
     ppd.WindowState = FormWindowState.Maximized;
     ppd.Icon = WB.Form.Icon;
     ppd.Document = doc;
     return ppd.ShowDialog(WB.Form);
 }
Пример #3
0
 public DialogResult ShowPageSetupDialog(ScintillaPrintDocument doc)
 {
     var psd = new PageSetupDialog();
     psd.AllowPrinter = true;
     psd.PageSettings = doc.DefaultPageSettings;
     psd.PrinterSettings = doc.DefaultPageSettings.PrinterSettings;
     return psd.ShowDialog(WB.Form);
 }
Пример #4
0
        public void PageSetup(Document doc)
        {
            var sci = App.GetService<IEditorService>().GetEditor(doc.GetType()).Instance.Control as ScintillaControl;

            if (sci != null)
            {
                var printDoc = new ScintillaPrintDocument(sci, doc.Title);

                if (ShowPageSetupDialog(printDoc) == DialogResult.OK)
                    Print(false, printDoc);
            }
        }
Пример #5
0
 internal PrintHelper(IWin32Window window, ScintillaPrintDocument printDocument)
 {
     this.window = window;
     PrintDocument = printDocument;
 }