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)); }
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)); }
public static bool GetChildValueBool(XElement parent, string childName) { var child = GetChildOrThrow(parent, childName); return(XElementExtensions.ParseBool(child.Value)); }