/// <summary> /// Finds a node by its path. /// </summary> /// <param name="path">The node path.</param> /// <returns>The node if found; otherwise, null.</returns> public virtual ISolutionTreeNode?FindTreeNode(ITreeNodePath?path) { if (path == null) { return(null); } if (path.IsEqual(Path)) { return(this); } foreach (ISolutionTreeNode Child in Children) { if (path.IsEqual(Child.Path)) { return(Child); } if (Child is ISolutionFolder AsFolder) { ISolutionTreeNode?TreeNode = AsFolder.FindTreeNode(path); if (TreeNode != null) { return(TreeNode); } } } return(null); }
private void AddChilrenToTable(Dictionary <IFolderPath, ISolutionFolder> flatChildrenTable) { flatChildrenTable.Add((IFolderPath)Path, this); foreach (ISolutionTreeNode Child in Children) { if (Child is SolutionFolder AsFolder) { AsFolder.AddChilrenToTable(flatChildrenTable); } } }
private void AddChilrenToTable(Dictionary <IFolderPath, ISolutionFolder> FlatChildrenTable) { FlatChildrenTable.Add((IFolderPath)Path, this); foreach (ISolutionTreeNode Child in Children) { SolutionFolder AsFolder; if ((AsFolder = Child as SolutionFolder) != null) { AsFolder.AddChilrenToTable(FlatChildrenTable); } } }