WebMarkupMin.Core.Parsers.HtmlParser.GetAttributeType C# (CSharp) Method

GetAttributeType() private method

Gets a HTML attribute type
private GetAttributeType ( string tagNameInLowercase, WebMarkupMin.Core.Parsers.HtmlTagFlags tagFlags, string attributeNameInLowercase, IList attributes ) : HtmlAttributeType
tagNameInLowercase string Tag name in lowercase
tagFlags WebMarkupMin.Core.Parsers.HtmlTagFlags Tag flags
attributeNameInLowercase string Attribute name in lowercase
attributes IList List of attributes
return HtmlAttributeType
        private HtmlAttributeType GetAttributeType(string tagNameInLowercase, HtmlTagFlags tagFlags,
			string attributeNameInLowercase, IList<HtmlAttribute> attributes)
        {
            HtmlAttributeType attributeType = HtmlAttributeType.Unknown;

            if (attributeNameInLowercase == "class")
            {
                attributeType = HtmlAttributeType.ClassName;
            }
            else if (attributeNameInLowercase == "style")
            {
                attributeType = HtmlAttributeType.Style;
            }
            else if (HtmlAttributeTypeHelpers.IsEventAttribute(attributeNameInLowercase))
            {
                attributeType = HtmlAttributeType.Event;
            }

            if (attributeType == HtmlAttributeType.Unknown && !tagFlags.HasFlag(HtmlTagFlags.Xml))
            {
                if (HtmlAttributeTypeHelpers.IsBooleanAttribute(attributeNameInLowercase))
                {
                    attributeType = HtmlAttributeType.Boolean;
                }
                else if (HtmlAttributeTypeHelpers.IsNumericAttribute(tagNameInLowercase, attributeNameInLowercase))
                {
                    attributeType = HtmlAttributeType.Numeric;
                }
                else if (HtmlAttributeTypeHelpers.IsUriBasedAttribute(tagNameInLowercase, attributeNameInLowercase,
                    attributes))
                {
                    attributeType = HtmlAttributeType.Uri;
                }
            }

            if (attributeType == HtmlAttributeType.Unknown)
            {
                attributeType = HtmlAttributeTypeHelpers.IsXmlBasedAttribute(attributeNameInLowercase) ?
                    HtmlAttributeType.Xml : HtmlAttributeType.Text;
            }

            return attributeType;
        }