コード例 #1
0
		public static XpsRenderer CreateInstance (PagesCollection pages) {
			if (pages == null) {
				throw new ArgumentNullException("pages");
			}
			XpsRenderer instance = new XpsRenderer(pages);
			return instance;
		}
コード例 #2
0
 /// <summary>
 /// PrintDocument_PrintPage: Controls page printing of the report based on the number of pages selected per sheet.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
 {
     if (_currentPageIndex < _pageCount)
     {
         RectangleF bounds = e.PageBounds;
         bounds.Width  = e.Graphics.VisibleClipBounds.Width;
         bounds.Height = e.Graphics.VisibleClipBounds.Height;
         if (_currentPageIndex == 0)
         {
             _pagesAcross           = _numberOfPagesPerPrinterPage / 2;
             _pagesDown             = _numberOfPagesPerPrinterPage / _pagesAcross;
             _pageScaledSize.Width  = (bounds.Width - (SpaceBetweenPages * (_pagesAcross - 1))) / _pagesAcross;
             _pageScaledSize.Height = (bounds.Height - (SpaceBetweenPages * (_pagesDown - 1))) / _pagesDown;
             _scaleFactor           = _pageScaledSize.Width / _maxPageSize.Width;
             if (_scaleFactor > _pageScaledSize.Height / _maxPageSize.Height)
             {
                 _scaleFactor = _pageScaledSize.Height / _maxPageSize.Height;
             }
         }
         RectangleF printRectangle = bounds;
         printRectangle.Width  = _pageScaledSize.Width;
         printRectangle.Height = _pageScaledSize.Height;
         RectangleF      pageRectangleInches = RectangleF.Empty;
         RectangleF      pageRectangle       = RectangleF.Empty;
         int             column     = 0;
         int             startIndex = _currentPageIndex;
         PagesCollection pages      = arViewer.Document.Pages;
         for (; _currentPageIndex < _pageCount && (startIndex == _currentPageIndex || _currentPageIndex % _numberOfPagesPerPrinterPage != 0); this._currentPageIndex++)
         {
             Page page = pages[_currentPageIndex];
             pageRectangleInches.X      = printRectangle.X / 100;
             pageRectangleInches.Y      = printRectangle.Y / 100;
             pageRectangleInches.Width  = page.Width * _scaleFactor;
             pageRectangleInches.Height = page.Height * _scaleFactor;
             pageRectangle        = printRectangle;
             pageRectangle.Width  = page.Width * 100 * _scaleFactor;
             pageRectangle.Height = page.Height * 100 * _scaleFactor;
             e.Graphics.DrawRectangle(Pens.Black, Rectangle.Round(pageRectangle));
             page.Draw(e.Graphics, pageRectangleInches, _scaleFactor, _scaleFactor, true);
             column++;
             if (column >= _pagesAcross)
             {
                 column            = 0;
                 printRectangle.X  = bounds.X;
                 printRectangle.Y += printRectangle.Height + SpaceBetweenPages;
             }
             else
             {
                 printRectangle.X += printRectangle.Width + SpaceBetweenPages;
             }
         }
     }
     _currentNumberOfPagesPrinted++;
     e.HasMorePages = _currentNumberOfPagesPrinted < _numberOfPagesToPrint;
     if (!e.HasMorePages)
     {
         _currentPageIndex = 0;
     }
 }
コード例 #3
0
ファイル: PrintRenderer.cs プロジェクト: ootsby/SharpDevelop
		private PrintRenderer(PagesCollection pages):base(pages)
		{
			doc = new PrintDocument();
//			doc.QueryPageSettings += new QueryPageSettingsEventHandler(OnQueryPage);
			doc.BeginPrint += new PrintEventHandler(OnBeginPrint);
			doc.EndPrint += new PrintEventHandler(OnEndPrint);
			doc.PrintPage += new PrintPageEventHandler(OnPrintPage);
		}
コード例 #4
0
        private PrintRenderer(PagesCollection pages) : base(pages)
        {
            doc = new PrintDocument();
//			doc.QueryPageSettings += new QueryPageSettingsEventHandler(OnQueryPage);
            doc.BeginPrint += new PrintEventHandler(OnBeginPrint);
            doc.EndPrint   += new PrintEventHandler(OnEndPrint);
            doc.PrintPage  += new PrintPageEventHandler(OnPrintPage);
        }
コード例 #5
0
ファイル: Application.cs プロジェクト: OneLoveMarvel/AvtoTest
        public Application(ICapabilities capabilities, string baseUrl, string hubUrl)
        {
            Pages = new PagesCollection(capabilities, baseUrl, hubUrl);

            // 2 - привязываем действие к отсылке
            //Auth = new AuthorizationModul(Pages);
            Sous = new SourceTopathlete(Pages);
        }
コード例 #6
0
        private void AddPageToCollection() //default page
        {
            PageViewModel pvm = new PageViewModel();

            PagesCollection.Add(new PageView {
                DataContext = pvm
            });
        }
コード例 #7
0
ファイル: PrintRenderer.cs プロジェクト: nylen/SharpDevelop
		private PrintRenderer(PagesCollection pages):base(pages)
		{
			this.PrintDocument = new PrintDocument();
			this.PrintDocument.PrinterSettings = new PrinterSettings();

			this.PrintDocument.BeginPrint += new PrintEventHandler(OnBeginPrint);
			this.PrintDocument.EndPrint += new PrintEventHandler(OnEndPrint);
			this.PrintDocument.PrintPage += new PrintPageEventHandler(OnPrintPage);
		}
コード例 #8
0
        private PrintRenderer(PagesCollection pages) : base(pages)
        {
            this.PrintDocument = new PrintDocument();
            this.PrintDocument.PrinterSettings = new PrinterSettings();

            this.PrintDocument.BeginPrint += new PrintEventHandler(OnBeginPrint);
            this.PrintDocument.EndPrint   += new PrintEventHandler(OnEndPrint);
            this.PrintDocument.PrintPage  += new PrintPageEventHandler(OnPrintPage);
        }
コード例 #9
0
		public PreviewViewModel(ReportSettings reportSettings, PagesCollection pages)
		{
			this.Pages = pages;
			FixedDocumentRenderer renderer =  FixedDocumentRenderer.CreateInstance(reportSettings,Pages);
			renderer.Start();
			renderer.RenderOutput();
			renderer.End();
			this.Document = renderer.Document;
		}
コード例 #10
0
ファイル: PrintRenderer.cs プロジェクト: ootsby/SharpDevelop
		public static PrintRenderer CreateInstance(PagesCollection pages,
		                                           PrinterSettings printerSettings)
		{
			if (pages == null) {
				throw new ArgumentNullException("pages");
			}
			PrintRenderer instance = new PrintRenderer(pages);
			instance.PrinterSettings = printerSettings;
			return instance;
		}
コード例 #11
0
        private void AddPageToCollection(ScorePartwiseMusicXML sp) //default page
        {
            id = sp.ID;
            int           index = pageCollection.Count;
            PageViewModel pvm   = new PageViewModel(sp, index);

            PagesCollection.Add(new PageView {
                DataContext = pvm
            });
        }
コード例 #12
0
        public PreviewViewModel(ReportSettings reportSettings, PagesCollection pages)
        {
            this.Pages = pages;
            FixedDocumentRenderer renderer = FixedDocumentRenderer.CreateInstance(reportSettings, Pages);

            renderer.Start();
            renderer.RenderOutput();
            renderer.End();
            this.Document = renderer.Document;
        }
コード例 #13
0
        /// <summary>
        /// Send's output to the StandartPrinter
        /// </summary>
        /// <param name="pages"></param>
        /// <returns>PrintRenderer</returns>
        public static PrintRenderer CreateInstance(PagesCollection pages)
        {
            if (pages == null)
            {
                throw new ArgumentNullException("pages");
            }
            PrintRenderer instance = new PrintRenderer(pages);

            return(instance);
        }
コード例 #14
0
        public void AddScorePage(ScoreLayout.AbstractScorePage scorePage)
        {
            IsBlank = false;
            id      = scorePage.Id;
            var number = PagesCollection.Count + 1;
            var pvm    = new PageViewModel(scorePage)
            {
                PageNumber = number + "", PageNumberAlignment = number % 2 == 0 ? TextAlignment.Right : TextAlignment.Left
            };

            PagesCollection.Add(new PageView {
                DataContext = pvm
            });
        }
コード例 #15
0
		/// <summary>
		/// For internal use only
		/// </summary>
		/// <param name="reportSettings"></param>
		/// <param name="pages"></param>
		/// <param name="fileName"></param>
		/// <param name="showOutput"></param>
		/// <returns></returns>
		public static PdfRenderer CreateInstance (ReportSettings reportSettings,PagesCollection pages,string fileName,bool showOutput) {	
		                                          
			if ((pages == null) ||(pages.Count == 0)) {
				throw new ArgumentNullException("pages");
			}
			if (String.IsNullOrEmpty(fileName)) {
				throw new ArgumentNullException("fileName");
			}
			
			PdfRenderer instance = new PdfRenderer(pages);
			instance.fileName = fileName;
			instance.reportSettings = reportSettings;
			instance.showOutput = showOutput;
			return instance;
		}
コード例 #16
0
        /// <summary>
        /// For internal use only
        /// </summary>
        /// <param name="reportSettings"></param>
        /// <param name="pages"></param>
        /// <param name="fileName"></param>
        /// <param name="showOutput"></param>
        /// <returns></returns>
        public static PdfRenderer CreateInstance(ReportSettings reportSettings, PagesCollection pages, string fileName, bool showOutput)
        {
            if ((pages == null) || (pages.Count == 0))
            {
                throw new ArgumentNullException("pages");
            }
            if (String.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }

            PdfRenderer instance = new PdfRenderer(pages);

            instance.fileName       = fileName;
            instance.reportSettings = reportSettings;
            instance.showOutput     = showOutput;
            return(instance);
        }
コード例 #17
0
        public PageManagerTabs()
        {
            internalImages = HeaparResource.LoadBitmapStrip(Type.GetType("heaparessential.Controls.PageManager"),
                                                            "heaparessential.Resources.ImagesTabControl.bmp",
                                                            new Size(imageButtonWidth, imageButtonHeight),
                                                            new Point(0, 0));

            InitializeComponent();

            InitControlPanel();

            pagesCollection           = new PagesCollection();
            pagesCollection.Cleared  += new EventHandler(OnTabCollectionCleared);
            pagesCollection.Inserted += new CollectionChange(OnTabCollectionInserted);
            pagesCollection.Removed  += new CollectionChange(OnTabCollectionRemoved);

            this.SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);
        }
コード例 #18
0
        /// <summary>
        /// PrintMultiplePagesPerSheetForm_Load: Run the sample report and load it into the viewer control (first 20 pages - report normally runs to 100 pages).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PrintMultiplePagesPerSheetForm_Load(object sender, EventArgs e)
        {
            //Define and run the Invoice report
            var rpt = new SectionReport();

            rpt.LoadLayout(XmlReader.Create(Properties.Resources.Invoice));
            ((Data.OleDBDataSource)rpt.DataSource).ConnectionString = Properties.Resources.ConnectionString;
            rpt.Run(false);

            //Remove all but the first 20 pages from the generated report.
            while (rpt.Document.Pages.Count > 20)
            {
                rpt.Document.Pages.RemoveAt(rpt.Document.Pages.Count - 1);
            }

            arViewer.Document  = rpt.Document;
            apiViewer.Document = rpt.Document;

            // Find the maximum page size.
            PagesCollection pages = arViewer.Document.Pages;
            Page            page;

            _pageCount = pages.Count;
            for (int pageIndex = 0; pageIndex < _pageCount; pageIndex++)
            {
                page = pages[pageIndex];
                if (_maxPageSize.Width < page.Size.Width)
                {
                    _maxPageSize.Width = page.Size.Width;
                }

                if (_maxPageSize.Height < page.Size.Height)
                {
                    _maxPageSize.Height = page.Size.Height;
                }
            }

            // Convert to document units.
            _maxPageSize.Width  *= 100;
            _maxPageSize.Height *= 100;

            cmbPageCount.SelectedIndex = cmbPageCountAPI.SelectedIndex = 0;
        }
コード例 #19
0
        public void TestMethod1()
        {
            //arrange
            string expected = "перехожу на с 1 на 3";
            //act
            PagesCollection col = new PagesCollection();

            col.AddPage("Первая страница");
            col.AddPage("Вторая страница");
            col.AddPage("Третья страница");

            col.Connect(0, 2, "перехожу на с 1 на 3");
            col.Connect(0, 1, "перехожу на с 1 на 2");

            string[] choices = col[0];
            string   actual  = choices[0];

            //actual
            Assert.AreEqual(expected, actual);
        }
コード例 #20
0
 private void SetupViewer(ReportModel reportModel)
 {
     this.pages          = new PagesCollection();
     this.reportSettings = reportModel.ReportSettings;
     this.AdjustDrawArea();
 }
コード例 #21
0
 public WPFReportPreview(ReportDesignerLoader loader, IViewContent content) : base(content)
 {
     this.designerLoader = loader;
     base.TabPageText    = "Wpf View";
     Pages = new PagesCollection();
 }
コード例 #22
0
		public BaseExportRenderer(PagesCollection pages)
		{
			this.pages = pages;
		}
コード例 #23
0
 private HtmlRenderer(PagesCollection pages) : base(pages)
 {
 }
コード例 #24
0
 public BaseExportRenderer(PagesCollection pages)
 {
     this.pages = pages;
 }
コード例 #25
0
 private FixedDocumentRenderer(ReportSettings reportSettings, PagesCollection pages) : base(pages)
 {
     this.pages          = pages;
     this.reportSettings = reportSettings;
     this.docCreator     = new FixedDocumentCreator();
 }
コード例 #26
0
ファイル: VacancyService.cs プロジェクト: Zilikaks/SuperParse
 public VacancyService()
 {
     UpdateSettings(string.Empty);
     _rootLoader = new RootLoader();
     _pages      = new PagesCollection <Root>(_rootLoader, _settings);
 }
コード例 #27
0
 public BaseTopathlete(PagesCollection pages)
 {
     this.pages = pages;
 }
コード例 #28
0
		public WPFReportPreview(ReportDesignerLoader loader,IViewContent content):base(content)
		{
			this.designerLoader = loader;
			base.TabPageText = "Wpf View";
			Pages = new PagesCollection();
		}
コード例 #29
0
ファイル: HTMLRenderer.cs プロジェクト: hpsa/SharpDevelop
		private HtmlRenderer(PagesCollection pages):base(pages)
		{
		}
コード例 #30
0
		public static FixedDocumentRenderer CreateInstance (ReportSettings reportSettings,PagesCollection pages)
		{
			var instance = new FixedDocumentRenderer(reportSettings,pages);
			return instance;
		}
コード例 #31
0
ファイル: ReportViewer.cs プロジェクト: hpsa/SharpDevelop
		private void SetupViewer (ReportModel reportModel)
		{
			this.pages = new PagesCollection();
			this.reportSettings = reportModel.ReportSettings;
			this.AdjustDrawArea();
		}
コード例 #32
0
ファイル: ExportRunner.cs プロジェクト: Rpinski/SharpDevelop
		public ExportRunner()
		{
			Pages = new PagesCollection();
		}
コード例 #33
0
 //немного магии
 public SourceTopathlete(PagesCollection pages)
     : base(pages)
 {
 }
コード例 #34
0
        public static FixedDocumentRenderer CreateInstance(ReportSettings reportSettings, PagesCollection pages)
        {
            var instance = new FixedDocumentRenderer(reportSettings, pages);

            return(instance);
        }
コード例 #35
0
 private PdfRenderer(PagesCollection pages) : base(pages)
 {
 }
コード例 #36
0
		private FixedDocumentRenderer(ReportSettings reportSettings,PagesCollection pages):base(pages)
		{
			this.pages  = pages;
			this.reportSettings = reportSettings;
			this.docCreator = new FixedDocumentCreator();
		}
コード例 #37
0
		private XpsRenderer(PagesCollection pages):base(pages)
		{
		}
コード例 #38
0
 public ExportRunner()
 {
     Pages = new PagesCollection();
 }