Esempio n. 1
0
        public static bool GetAttributeBool(XElement elem, string attrname)
        {
            var attr = elem.Attribute(attrname);

            if (attr == null)
            {
                throw new XMLStructureException("Attribute not found: " + attrname);
            }
            return(XElementExtensions.ParseBool(attr.Value));
        }
Esempio n. 2
0
        public static bool GetChildValue(XElement parent, string childName, bool defaultValue)
        {
            var child = parent.Elements(childName).FirstOrDefault();

            if (child == null)
            {
                return(defaultValue);
            }

            return(XElementExtensions.ParseBool(child.Value));
        }
Esempio n. 3
0
        public static bool GetChildValueBool(XElement parent, string childName)
        {
            var child = GetChildOrThrow(parent, childName);

            return(XElementExtensions.ParseBool(child.Value));
        }