private void CreateModuleTree(LibraryNode root, LibraryNode current, ScopeNode scope, string namePrefix, ModuleId moduleId) { if ((null == root) || (null == scope) || (null == scope.NestedScopes)) { return; } foreach (ScopeNode subItem in scope.NestedScopes) { PythonLibraryNode newNode = new PythonLibraryNode(subItem, namePrefix, moduleId.Hierarchy, moduleId.ItemID); string newNamePrefix = namePrefix; // The classes are always added to the root node, the functions to the // current node. if ((newNode.NodeType & LibraryNode.LibraryNodeType.Members) != LibraryNode.LibraryNodeType.None) { current.AddNode(newNode); } else if ((newNode.NodeType & LibraryNode.LibraryNodeType.Classes) != LibraryNode.LibraryNodeType.None) { // Classes are always added to the root. root.AddNode(newNode); newNamePrefix = newNode.Name + "."; } // Now use recursion to get the other types. CreateModuleTree(root, newNode, subItem, newNamePrefix, moduleId); } }
internal void AddNode(LibraryNode node) { lock (this) { root = new LibraryNode(root); root.AddNode(node); } }
internal void AddNode(LibraryNode node) { lock (this) { root = new LibraryNode(root); root.AddNode(node); } }
private void CreateModuleTree(LibraryNode root, LibraryNode current, ScopeNode scope, string namePrefix, ModuleId moduleId) { if ((null == root) || (null == scope) || (null == scope.NestedScopes)) { return; } foreach (ScopeNode subItem in scope.NestedScopes) { PythonLibraryNode newNode = new PythonLibraryNode(subItem, namePrefix, moduleId.Hierarchy, moduleId.ItemID); string newNamePrefix = namePrefix; // The classes are always added to the root node, the functions to the // current node. if ((newNode.NodeType & LibraryNode.LibraryNodeType.Members) != LibraryNode.LibraryNodeType.None) { current.AddNode(newNode); } else if ((newNode.NodeType & LibraryNode.LibraryNodeType.Classes) != LibraryNode.LibraryNodeType.None) { // Classes are always added to the root. root.AddNode(newNode); newNamePrefix = newNode.Name + "."; } // Now use recursion to get the other types. CreateModuleTree(root, newNode, subItem, newNamePrefix, moduleId); } }