/// <summary> /// Perform a depth-first traversal through this node and its descendants. /// </summary> /// <param name="nodeVisitor">the visitor callbacks to perform on each node</param> /// <returns>this node, for chaining</returns> internal Node Traverse(INodeVisitor nodeVisitor) { Validate.NotNull(nodeVisitor); NodeTraversor traversor = new NodeTraversor(nodeVisitor); traversor.Traverse(this); return this; }
private int CopySafeNodes(Element source, Element dest) { Cleaner.CleaningVisitor cleaningVisitor = new Cleaner.CleaningVisitor(this, source, dest); NodeTraversor traversor = new NodeTraversor(cleaningVisitor); traversor.Traverse(source); return cleaningVisitor.numDiscarded; }