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

GetLastPageForInsertingNewContent() приватный Метод

private GetLastPageForInsertingNewContent ( HtmlDom printingDom ) : XmlElement
printingDom HtmlDom
Результат XmlElement
        private XmlElement GetLastPageForInsertingNewContent(HtmlDom printingDom)
        {
            var lastPage =
                   printingDom.RawDom.SelectSingleNode("/html/body//div[contains(@class, 'bloom-page') and not(contains(@class,'bloom-frontMatter')) and not(contains(@class,'bloom-backMatter'))][last()]") as XmlElement;
            if(lastPage==null)
            {
                //currently nothing but front and back matter
                var lastFrontMatter= printingDom.RawDom.SelectSingleNode("/html/body//div[contains(@class,'bloom-frontMatter')][last()]") as XmlElement;
                if(lastFrontMatter ==null)
                    throw new ApplicationException("GetLastPageForInsertingNewContent() found no content pages nor frontmatter");
                return lastFrontMatter;
            }
            else
            {
                return (XmlElement) lastPage;
            }
        }
Book