BExIS.Xml.Helpers.XmlSchemaUtility.IsSimpleType C# (CSharp) Method

IsSimpleType() public static method

return true if a Element is a SimpleType
public static IsSimpleType ( XmlSchemaElement element ) : bool
element System.Xml.Schema.XmlSchemaElement
return bool
        public static bool IsSimpleType(XmlSchemaElement element)
        {
            if (element.ElementSchemaType is XmlSchemaSimpleType)
                return true;

            if (element.ElementSchemaType is XmlSchemaComplexType)
            {
                XmlSchemaComplexType complexType = (XmlSchemaComplexType)element.ElementSchemaType;
                if (complexType.ContentModel is XmlSchemaSimpleContent)
                    return true;
            }

            return false;
        }