private static void EvaluateElement(HtmlElement e, List<HtmlElement> result, Func<HtmlElement, bool> evaluator) { if (evaluator(e)) result.Add(e); foreach (HtmlElement child in e.ChildElements) EvaluateElement(child, result, evaluator); }
private static bool IsUnrelatedEndTag(HtmlElement e) { if (e.ElementType != HtmlElementType.EndTag) return false; return ((HtmlEndTag) e).StartTag == null; }