public void MakeModuleByPath(string filePath) { Queue <string> FullPathQueue = TreeContainer.GetFullPathQueue(filePath); string rootName = FullPathQueue.Dequeue(); int treeNodeIndex = childrenNodes.FindIndex(val => val.Name == rootName); if (treeNodeIndex != -1) { this.childrenNodes[treeNodeIndex].MakeModuleByPath(FullPathQueue); } }
public System.Windows.Forms.TreeNode AddPath(string filePath, bool isModule) { Queue <string> FullPathQueue = TreeContainer.GetFullPathQueue(filePath); string rootName = FullPathQueue.Dequeue(); int treeNodeIndex = childrenNodes.FindIndex(val => val.Name == rootName); if (treeNodeIndex == -1) { TreeNode newNode = new TreeNode(rootName, FullPathQueue, isModule); childrenNodes.Add(newNode); return(newNode.TreeViewNode); } else { this.childrenNodes[treeNodeIndex].AddFile(FullPathQueue, isModule); return(null); } }