Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        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);
                }
            }
        }