Beispiel #1
0
        ProjectFileNode Find(string[] path, int pathIndex, bool create)
        {
            ProjectFileNode child;

            if (Children.TryGetValue(path[pathIndex], out child))
            {
                if (pathIndex + 1 == path.Length)
                {
                    return(child);
                }

                return(child.Find(path, pathIndex + 1, create));
            }

            if (create)
            {
                child = new ProjectFileNode(this, path[pathIndex]);
                Children.Add(child.FileName, child);

                if (pathIndex + 1 == path.Length)
                {
                    return(child);
                }

                return(child.Find(path, pathIndex + 1, create));
            }

            return(null);
        }
Beispiel #2
0
 public ProjectFileNode(ProjectFileNode parent, string fileName)
 {
     Children    = new SortedList <string, ProjectFileNode> ();
     FileName    = fileName;
     ProjectFile = null;
     Parent      = parent;
 }
Beispiel #3
0
 public ProjectFileNode(ProjectFileNode parent, ProjectFile file)
 {
     Children    = new SortedList <string, ProjectFileNode> ();
     FileName    = file.ProjectVirtualPath.FileName;
     ProjectFile = file;
     Parent      = parent;
 }
Beispiel #4
0
        void PruneEmptyParents(ProjectFileNode node)
        {
            if (node.Children.Count > 0 || node.ProjectFile != null || node.Parent == null)
            {
                return;
            }

            node.Parent.Children.Remove(node.FileName);
            PruneEmptyParents(node.Parent);
        }
Beispiel #5
0
 public ProjectFileCollection()
 {
     files = ImmutableDictionary <FilePath, ProjectFile> .Empty;
     root  = new ProjectFileNode();
 }
 public ProjectFileCollection()
 {
     files = new Dictionary <FilePath, ProjectFile> ();
     root  = new ProjectFileNode();
 }