コード例 #1
0
 /// <summary>
 /// Adds a attribute expression, that define what attributes can not be removed, to the list
 /// </summary>
 /// <param name="attributeExpression">Attribute expression, that define what attributes can not be removed</param>
 public void AddPreservableAttribute(HtmlAttributeExpression attributeExpression)
 {
     if (!_preservableAttributes.Contains(attributeExpression))
     {
         _preservableAttributes.Add(attributeExpression);
     }
 }
コード例 #2
0
        /// <summary>
        /// Adds a string representation of attribute expression, that define what attributes can not be
        /// removed, to the list
        /// </summary>
        /// <param name="attributeExpressionString">String representation of attribute expression, that
        /// define what attributes can not be removed</param>
        /// <returns>true - valid expression; false - invalid expression</returns>
        public bool AddPreservableAttribute(string attributeExpressionString)
        {
            HtmlAttributeExpression attributeExpression;

            if (HtmlAttributeExpression.TryParse(attributeExpressionString, out attributeExpression))
            {
                AddPreservableAttribute(attributeExpression);
                return(true);
            }

            return(false);
        }