Example #1
0
        public void InsertPage(int docIndex, int insertAfterPageIndex, FixedPage page)
        {
            RollUpFixedDocument rollUpFixedDocument = _documents[docIndex];

            TestForExistingPages(rollUpFixedDocument);
            rollUpFixedDocument.Pages.Insert(docIndex, new RollUpFixedPage(page));
            _fixedDocumentSequence = null;
        }
Example #2
0
        public void RemovePage(int docIndex, int pageIndex)
        {
            RollUpFixedDocument rollUpFixedDocument = _documents[docIndex];

            TestForExistingPages(rollUpFixedDocument);
            rollUpFixedDocument.Pages.RemoveAt(pageIndex);
            _fixedDocumentSequence = null;
        }
Example #3
0
        public void AddPage(int docIndex, Uri source, Uri uri)
        {
            RollUpFixedDocument rollUpFixedDocument = _documents[docIndex];

            TestForExistingPages(rollUpFixedDocument);
            rollUpFixedDocument.Pages.Add(new RollUpFixedPage(source, uri));
            _fixedDocumentSequence = null;
        }
Example #4
0
        public void AddPage(int docIndex, FixedPage page)
        {
            RollUpFixedDocument rollUpFixedDocument = _documents[docIndex];

            TestForExistingPages(rollUpFixedDocument);
            rollUpFixedDocument.Pages.Add(new RollUpFixedPage(page));
            _fixedDocumentSequence = null;
        }
Example #5
0
        public void InsertPage(int docIndex, int insertAfterPageIndex, Uri source, Uri uri)
        {
            RollUpFixedDocument rollUpFixedDocument = _documents[docIndex];

            TestForExistingPages(rollUpFixedDocument);
            rollUpFixedDocument.Pages.Insert(insertAfterPageIndex, new RollUpFixedPage(source, uri));
            _fixedDocumentSequence = null;
        }
Example #6
0
        public int GetPageCount(int docIndex)
        {
            RollUpFixedDocument fixedDocument = _documents[docIndex];

            if (fixedDocument.BaseUri != null)
            {
                fixedDocument.CreatePagesFromSource();
            }
            return(fixedDocument.Pages.Count);
        }
Example #7
0
 private void TestForExistingPages(RollUpFixedDocument rollUpFixedDocument)
 {
     if (rollUpFixedDocument.BaseUri != null)
     {
         rollUpFixedDocument.CreatePagesFromSource();
     }
     else if (rollUpFixedDocument.FixedDocument != null)
     {
         rollUpFixedDocument.CreatePagesFromFixedDocument();
     }
 }
Example #8
0
 private void FillDocumentReference(DocumentReference documentReference, RollUpFixedDocument document)
 {
     if (document.BaseUri != null)
     {
         documentReference.Source = document.Source;
         (documentReference as IUriContext).BaseUri = document.BaseUri;
     }
     else if (document.FixedDocument != null)
     {
         documentReference.SetDocument(document.FixedDocument);
     }
     else
     {
         AddPages(documentReference, document);
     }
 }
Example #9
0
        public PageContent GetPage(int docIndex, int pageIndex)
        {
            RollUpFixedDocument fixedDocument = _documents[docIndex];

            if (fixedDocument.BaseUri != null)
            {
                fixedDocument.CreatePagesFromSource();
            }

            PageContent     pageContent = new PageContent();
            RollUpFixedPage fixedPage   = fixedDocument.Pages[pageIndex];

            pageContent.Source = fixedPage.Source;
            (pageContent as IUriContext).BaseUri = fixedPage.BaseUri;
            return(pageContent);
        }
Example #10
0
        private void AddPages(DocumentReference documentReference, RollUpFixedDocument document)
        {
            FixedDocument fixedDocument = new FixedDocument();

            documentReference.SetDocument(fixedDocument);
            foreach (RollUpFixedPage page in document.Pages)
            {
                PageContent pageContent = new PageContent();
                if (page.BaseUri == null)
                {
                    (pageContent as IAddChild).AddChild(page.FixedPage);
                }
                else
                {
                    pageContent.Source = page.Source;
                    (pageContent as IUriContext).BaseUri = page.BaseUri;
                }
                pageContent.GetPageRoot(true);
                fixedDocument.Pages.Add(pageContent);
            }
        }