/// <summary> /// Returns a collection containing this element and all descendant elements. /// </summary> public static IEnumerable <HTMLElementNode> DescendantsAndSelf(this HTMLElementNode adapter) { yield return(adapter); foreach (HTMLElementNode child in adapter.Descendants()) { yield return(child); } }
/// <summary> /// Returns a collection of descendant elements. /// </summary> public static IEnumerable <HTMLElementNode> Descendants <T>(this HTMLElementNode adapter) { return(adapter.Descendants().Where(i => i is T)); }