Is it possible to economize the loop in the following code snippet (element is of type XElement)?
TreeViewItem root = new TreeViewItem();
foreach (XAttribute attr in element.Attributes()) {
root.HtmlAttributes.Add(attr.Name.ToString(),attr.Value);
}
So that I could pass lists as parameter to the function something like:
root.HtmlAttributes(element.Attributes.Names,element.Attributes.Values)