Пример #1
0
        public PictureBoxPrinter(PictureBox pictureBox, IPageSetupDialogFacade pageSetupDialogFacade, IPrintPreviewDialogFacade printPreviewDialogFacade, IPrintDialogFacade printDialogFacade, IPrintDocumentFacade printDocumentFacade)
        {
            TargetControl = pictureBox;

            _pageSetupDialogFacade    = pageSetupDialogFacade;
            _printPreviewDialogFacade = printPreviewDialogFacade;
            _printDialogFacade        = printDialogFacade;
            _printDocumentFacade      = printDocumentFacade;

            _printDocumentFacade.BindPrintPageEvent(this);
        }
Пример #2
0
        public RichTextBoxPrinter(RichTextBox richTextBox, IPageSetupDialogFacade pageSetupDialogFacade, IPrintPreviewDialogFacade printPreviewDialogFacade, IPrintDialogFacade printDialogFacade, IPrintDocumentFacade printDocumentFacade)
        {
            TargetControl = richTextBox;

            _pageSetupDialogFacade    = pageSetupDialogFacade;
            _printPreviewDialogFacade = printPreviewDialogFacade;
            _printDialogFacade        = printDialogFacade;
            _printDocumentFacade      = printDocumentFacade;

            _printDocumentFacade.BindBeginPrintEvent(this);
            _printDocumentFacade.BindEndPrintEvent(this);
            _printDocumentFacade.BindPrintPageEvent(this);
        }
Пример #3
0
        public void SetUp()
        {
            _pictureBox               = new PictureBox();
            _pageSetupDialog          = new PageSetupDialog();
            _pageSetupDialogFacade    = Substitute.For <IPageSetupDialogFacade>();
            _printDialog              = new PrintDialog();
            _printDialogFacade        = Substitute.For <IPrintDialogFacade>();
            _printDocument            = new PrintDocument();
            _printDocumentFacade      = Substitute.For <IPrintDocumentFacade>();
            _printPreviewDialog       = new PrintPreviewDialog();
            _printPreviewDialogFacade = Substitute.For <IPrintPreviewDialogFacade>();

            _printer = new PictureBoxPrinter(_pictureBox, _pageSetupDialogFacade, _printPreviewDialogFacade, _printDialogFacade, _printDocumentFacade);
        }
Пример #4
0
        public void SetUp()
        {
            _richTextBox = new RichTextBox();

            _pageSetupDialog       = new PageSetupDialog();
            _pageSetupDialogFacade = Substitute.For <IPageSetupDialogFacade>();
            _pageSetupDialogFacade.PageSetupDialog.Returns(_pageSetupDialog);

            _printDialog       = new PrintDialog();
            _printDialogFacade = Substitute.For <IPrintDialogFacade>();
            _printDialogFacade.PrintDialog.Returns(_printDialog);

            _printDocument = new PrintDocument {
                DefaultPageSettings = { Margins = new Margins(10, 20, 30, 40) }
            };
            _printDocumentFacade = Substitute.For <IPrintDocumentFacade>();
            _printDocumentFacade.PrintDocument.Returns(_printDocument);

            _printPreviewDialog       = new PrintPreviewDialog();
            _printPreviewDialogFacade = Substitute.For <IPrintPreviewDialogFacade>();
            _printPreviewDialogFacade.PrintPreviewDialog.Returns(_printPreviewDialog);

            _printer = new RichTextBoxPrinter(_richTextBox, _pageSetupDialogFacade, _printPreviewDialogFacade, _printDialogFacade, _printDocumentFacade);
        }
Пример #5
0
        public void SetUp()
        {
            pictureBox = new PictureBox();
            pageSetupDialog = new PageSetupDialog();
            pageSetupDialogFacade = Substitute.For<IPageSetupDialogFacade>();
            printDialog = new PrintDialog();
            printDialogFacade = Substitute.For<IPrintDialogFacade>();
            printDocument = new PrintDocument();
            printDocumentFacade = Substitute.For<IPrintDocumentFacade>();
            printPreviewDialog = new PrintPreviewDialog();
            printPreviewDialogFacade = Substitute.For<IPrintPreviewDialogFacade>();

            printer = new PictureBoxPrinter(pictureBox, pageSetupDialogFacade, printPreviewDialogFacade, printDialogFacade, printDocumentFacade);
        }
Пример #6
0
        public void SetUp()
        {
            richTextBox = new RichTextBox();

            pageSetupDialog = new PageSetupDialog();
            pageSetupDialogFacade = Substitute.For<IPageSetupDialogFacade>();
            pageSetupDialogFacade.PageSetupDialog.Returns(pageSetupDialog);

            printDialog = new PrintDialog();
            printDialogFacade = Substitute.For<IPrintDialogFacade>();
            printDialogFacade.PrintDialog.Returns(printDialog);

            printDocument = new PrintDocument { DefaultPageSettings = {Margins = new Margins(10, 20, 30, 40)}};
            printDocumentFacade = Substitute.For<IPrintDocumentFacade>();
            printDocumentFacade.PrintDocument.Returns(printDocument);

            printPreviewDialog = new PrintPreviewDialog();
            printPreviewDialogFacade = Substitute.For<IPrintPreviewDialogFacade>();
            printPreviewDialogFacade.PrintPreviewDialog.Returns(printPreviewDialog);

            printer = new RichTextBoxPrinter(richTextBox, pageSetupDialogFacade, printPreviewDialogFacade, printDialogFacade, printDocumentFacade);
        }