示例#1
0
        static IEnumerable <JsParentedNode> Descendants(this JsParentedNode node)
        {
            var list = node.Children().ToList();

            for (var i = 0; i < list.Count; i++)
            {
                var child = list[i];
                yield return(child);

                if (child.Node != null)
                {
                    var children = child.Children();
                    list.AddRange(children);
                }
            }
        }
示例#2
0
 static IEnumerable <JsParentedNode> Children(this JsParentedNode node)
 {
     return(node.Node.Children().Select(t => new JsParentedNode(t, node)));
 }
示例#3
0
 public JsParentedNode(JsNode node, JsParentedNode parent)
 {
     Node   = node;
     Parent = parent;
 }