internal static bool?GetOwnAttributeBoolNullable(this XElement?element, string attribute)
        {
            var value = element.GetOwnAttribute(attribute);

            if (value == null)
            {
                return(null);
            }

            return(XmlAttributeValueHelper.ParseOnOffValue(value));
        }
Exemple #2
0
        internal static bool?GetSingleElementOnOffNullable(this XElement xml, string element, string attribute, bool defaultValue)
        {
            var e = xml.Element(XName.Get(element, Namespaces.w.NamespaceName));

            if (e == null)
            {
                return(null);
            }

            var a = e.Attribute(XName.Get(attribute, Namespaces.w.NamespaceName));

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

            return(XmlAttributeValueHelper.ParseOnOffValue(a.Value));
        }