Пример #1
0
 public IEnumerable <HElement> Ancestors()
 {
     for (HElement node = this.ParentNode; node.ParentNode != null; node = node.ParentNode)
     {
         yield return(node.ParentNode);
     }
 }
Пример #2
0
 public IEnumerable <HElement> Ancestors(string name)
 {
     for (HElement n = this.ParentNode; n != null; n = n.ParentNode)
     {
         if (n.Name == name)
         {
             yield return(n);
         }
     }
 }