Beispiel #1
0
        /// <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);
            }
        }
Beispiel #2
0
 /// <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));
 }