Exemple #1
0
        /// <summary>
        /// Clears the given attribute collection.
        /// </summary>
        /// <param name="attributes">The collection to clear.</param>
        /// <returns>The collection itself.</returns>
        public static INamedNodeMap Clear(this INamedNodeMap attributes)
        {
            if (attributes == null)
            {
                throw new ArgumentNullException(nameof(attributes));
            }

            while (attributes.Length > 0)
            {
                var name = attributes[attributes.Length - 1].Name;
                attributes.RemoveNamedItem(name);
            }

            return(attributes);
        }
Exemple #2
0
 bool IElement.RemoveAttribute(string name)
 {
     return(attributes.RemoveNamedItem(name) != null);
 }