Bloom.Book.Book.BringPageUpToDate C# (CSharp) Метод

BringPageUpToDate() публичный Метод

Bring the page up to date. Currently this is used to switch various old page types to new versions based on Custom Page (so they can actually be customized).
public BringPageUpToDate ( XmlElement page ) : void
page System.Xml.XmlElement
Результат void
        public void BringPageUpToDate(XmlElement page)
        {
            var lineageAttr = page.Attributes["data-pagelineage"];
            if (lineageAttr == null)
                return;
            var lineage = lineageAttr.Value;
            var originalTemplateGuid = lineage;
            int index = lineage.IndexOf(";", StringComparison.InvariantCulture);
            if (index >= 0)
                originalTemplateGuid = lineage.Substring(0, index);
            GuidAndPath updateTo;
            if (!PageMigrations.TryGetValue(originalTemplateGuid, out updateTo))
                return; // Not one we want to migrate. Possibly already done, or one we don't want to convert, or created in the field...
            var layoutOfThisBook = GetLayout();
            var bookPath = BloomFileLocator.GetFactoryBookTemplateDirectory(updateTo.Path);
            var templateDoc = XmlHtmlConverter.GetXmlDomFromHtmlFile(bookPath, false);
            var newPage = (XmlElement)templateDoc.SafeSelectNodes("//div[@id='" + updateTo.Guid + "']")[0];
            var classesToDrop = new[] { "imageWholePage","imageOnTop","imageInMiddle","imageOnBottom","textWholePage","pictureAndWordPage" };
            HtmlDom.MergeClassesIntoNewPage(page, newPage, classesToDrop);
            SizeAndOrientation.UpdatePageSizeAndOrientationClasses(newPage, layoutOfThisBook);
            OurHtmlDom.MigrateEditableData(page, newPage, lineage.Replace(originalTemplateGuid, updateTo.Guid));
        }
Book