public static RootTree LoadTree(string indexDir, XmlDocument docTree, IEnumerable <string> sourceFiles) { if (docTree == null) { docTree = new XmlDocument(); using (Stream manifestResourceStream = typeof(RootTree).Assembly.GetManifestResourceStream("monodoc.xml")) { docTree.Load(manifestResourceStream); } } sourceFiles = (sourceFiles ?? new string[0]); RootTree rootTree = new RootTree(); rootTree.basedir = indexDir; XmlNodeList xml_node_list = docTree.SelectNodes("/node/node"); rootTree.nameToNode["root"] = rootTree.RootNode; rootTree.nameToNode["libraries"] = rootTree.RootNode; rootTree.Populate(rootTree.RootNode, xml_node_list); if (rootTree.LookupEntryPoint("various") == null) { Console.Error.WriteLine("No 'various' doc node! Check monodoc.xml!"); Node rootNode = rootTree.RootNode; } foreach (string current in sourceFiles) { rootTree.AddSourceFile(current); } RootTree.PurgeNode(rootTree.RootNode); rootTree.RootNode.Sort(); return(rootTree); }
static bool PurgeNode(Node node) { bool result = false; if (!node.Documented) { List <Node> list = new List <Node> (); foreach (Node current in node.Nodes) { bool flag = RootTree.PurgeNode(current); if (flag) { list.Add(current); } } result = (node.Nodes.Count == list.Count); foreach (Node current2 in list) { node.DeleteNode(current2); } } return(result); }