public void ProcessVisitor(TreeNodeVisitor visitor) { // get data context PPDataContext db = new PPDataContext(); // initialize visitor.Initialize(db); // get root node List<TreeNode> rootNodes = TreeNode.GetRootNodes(db); foreach (TreeNode tn in rootNodes) if (!tn.ProcessVisitor(db, visitor)) break; // finilize visitor.Finalize(db); }
public void ProcessVisitor(TreeNodeVisitor visitor) { // get data context PPDataContext db = new PPDataContext(); // initialize visitor.Initialize(db); // get root node List <TreeNode> rootNodes = TreeNode.GetRootNodes(db); foreach (TreeNode tn in rootNodes) { if (!tn.ProcessVisitor(db, visitor)) { break; } } // finilize visitor.Finalize(db); }