WebMarkupMin.Core.GenericHtmlMinifier.CanRemoveAttribute C# (CSharp) Метод

CanRemoveAttribute() приватный Метод

Checks whether remove an the attribute
private CanRemoveAttribute ( WebMarkupMin.Core.Parsers.HtmlTag tag, HtmlAttribute attribute ) : bool
tag WebMarkupMin.Core.Parsers.HtmlTag Tag
attribute WebMarkupMin.Core.Parsers.HtmlAttribute Attribute
Результат bool
        private bool CanRemoveAttribute(HtmlTag tag, HtmlAttribute attribute)
        {
            if (_settings.PreservableAttributeCollection.Count == 0)
            {
                return true;
            }

            string tagNameInLowercase = tag.NameInLowercase;
            string attributeNameInLowercase = attribute.NameInLowercase;
            string attributeValue = attribute.Value;

            bool result = true;

            foreach (HtmlAttributeExpression attributeExpression in _settings.PreservableAttributeCollection)
            {
                bool cannotRemove = attributeExpression.IsMatch(tagNameInLowercase, attributeNameInLowercase,
                    attributeValue);
                if (cannotRemove)
                {
                    result = false;
                    break;
                }
            }

            return result;
        }