Пример #1
0
        internal override void LoadDataFromXml(XmlElement element)
        {
            Clear();

            CheckTagName(element);

            XmlNodeList childList = element.ChildNodes;

            if (childList == null || childList.Count <= 0)
            {
                return;
            }

            // Just load page guid and name
            foreach (XmlElement childElement in childList)
            {
                DocumentPage page = null;
                if (_document.DocumentType == DocumentType.Library)
                {
                    page = new CustomObjectPage(_document, "");
                }
                else
                {
                    page = new StandardPage(_document, "");
                }
                page.PageData.Clear(); // Page data is cleared now.

                page.LoadDataFromXml(childElement);
                Add(page.Guid, page);
                page.OnAddToDocument();
            }
        }
Пример #2
0
        public IDocumentPage DuplicatePage(Guid pageGuid)
        {
            CheckOpen();

            if (!Pages.Contains(pageGuid))
            {
                throw new ArgumentException("pageGuid");
            }

            Serializer writer = new Serializer(_workingDirectoryGuid, Guid.Empty, _workingImagesDirectory);

            if (_documentData.DocumentType == DocumentType.Library)
            {
                CustomObjectPage sourcePage = Pages[pageGuid] as CustomObjectPage;
                writer.AddCustomObjectPage(sourcePage);
            }
            else
            {
                StandardPage sourcePage = Pages[pageGuid] as StandardPage;
                writer.AddStandardPage(sourcePage);
            }

            IDocumentPage newPage = null;

            using (Stream stream = writer.WriteToStream())
            {
                IObjectContainer container = AddPages(stream);
                if (_documentData.DocumentType == DocumentType.Library)
                {
                    if (container.CustomObjectPageList.Count > 0)
                    {
                        newPage = container.CustomObjectPageList[0];
                    }
                }
                else
                {
                    if (container.StandardPageList.Count > 0)
                    {
                        newPage = container.StandardPageList[0];
                    }
                }
            }

            return(newPage);
        }
Пример #3
0
        public IDocumentPage CreatePage(string pageName)
        {
            CheckOpen();

            DocumentPage page = null;

            if (_documentData.DocumentType == DocumentType.Library)
            {
                page = new CustomObjectPage(this, pageName);
            }
            else
            {
                page = new StandardPage(this, pageName);
            }

            AddPage(page);

            return(page);
        }
Пример #4
0
 internal StandardPageData(StandardPage page, string tagName)
     : base(page, tagName)
 {
     _events = new InteractionEvents(page);
 }