Bloom.Book.HtmlDom.GetBookSetting C# (CSharp) Method

GetBookSetting() public method

public GetBookSetting ( string key ) : MultiTextBase
key string
return MultiTextBase
        public MultiTextBase GetBookSetting(string key)
        {
            var result = new MultiTextBase();
            foreach(XmlElement e in RawDom.SafeSelectNodes("//div[@id='bloomDataDiv']/div[@data-book='" + key + "']"))
            {
                var lang = e.GetAttribute("lang");
                result.SetAlternative(lang ?? "", e.InnerXml);
            }
            return result;
        }

Usage Example

Example #1
0
        private static bool ShouldSetToDefaultCopyrightAndLicense(HtmlDom dom)
        {
            var hasCopyright    = !dom.GetBookSetting("copyright").Empty;
            var hasLicenseUrl   = !dom.GetBookSetting("licenseUrl").Empty;
            var hasLicenseNotes = !dom.GetBookSetting("licenseNotes").Empty;

            //Enhance: this logic is perhaps overly restrictive?
            return(!hasCopyright && !hasLicenseUrl && !hasLicenseNotes);
        }
All Usage Examples Of Bloom.Book.HtmlDom::GetBookSetting