/// <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); }
bool IElement.RemoveAttribute(string name) { return(attributes.RemoveNamedItem(name) != null); }