System.Data.XSDSchema.GetBooleanAttribute C# (CSharp) Method

GetBooleanAttribute() private method

private GetBooleanAttribute ( XmlSchemaAnnotated element, string attrName, bool defVal ) : bool
element System.Xml.Schema.XmlSchemaAnnotated
attrName string
defVal bool
return bool
        internal bool GetBooleanAttribute(XmlSchemaAnnotated element, string attrName, bool defVal)
        {
            string value = GetMsdataAttribute(element, attrName);
            if (value == null || value.Length == 0)
            {
                return defVal;
            }
            if ((value == Keywords.TRUE) || (value == Keywords.ONE_DIGIT))
            {
                return true;
            }
            if ((value == Keywords.FALSE) || (value == Keywords.ZERO_DIGIT))
            {
                return false;
            }
            // Error processing:
            throw ExceptionBuilder.InvalidAttributeValue(attrName, value);
        }