public static IEnumerable <HElement> Elements(this HContainer container, string name) { if (container.Children == null) { return(new HElement[0]); } return(container.Children.Where(c => c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase))); }
public static IEnumerable <HElement> Descendants(this HContainer container, string name) { foreach (var element in container.Elements(name)) { yield return(element); } foreach (var child in container.Children) { foreach (var element in child.Descendants(name)) { yield return(element); } } }