Exemple #1
0
        public IEnumerable <string> GetFilePaths(string file, string underProject)
        {
            var         result = new LinkedList <string>();
            VssFileInfo fileInfo;

            if (fileInfos.TryGetValue(file, out fileInfo))
            {
                VssProjectInfo underProjectInfo = null;
                if (underProject != null)
                {
                    if (!projectInfos.TryGetValue(underProject, out underProjectInfo))
                    {
                        return(result);
                    }
                }
                foreach (var project in fileInfo.Projects)
                {
                    if (underProjectInfo == null || project.IsSameOrSubproject(underProjectInfo))
                    {
                        // ignore projects that are not rooted
                        var projectPath = project.GetPath();
                        if (projectPath != null)
                        {
                            var path = Path.Combine(projectPath, fileInfo.LogicalName);
                            result.AddLast(path);
                        }
                    }
                }
            }
            return(result);
        }
Exemple #2
0
        public void SetProjectPath(string project, string path, string originalVssPath)
        {
            var projectInfo = new VssProjectInfo(project, path);

            projectInfo.IsRoot          = true;
            projectInfo.OriginalVssPath = originalVssPath;
            projectInfos[project]       = projectInfo;
            rootInfos[project]          = projectInfo;
        }
Exemple #3
0
        private VssProjectInfo GetOrCreateProject(VssItemName name)
        {
            VssProjectInfo projectInfo;

            if (!projectInfos.TryGetValue(name.PhysicalName, out projectInfo))
            {
                projectInfo = new VssProjectInfo(name.PhysicalName, name.LogicalName);
                projectInfos[name.PhysicalName] = projectInfo;
            }
            return(projectInfo);
        }
Exemple #4
0
        public bool IsSameOrSubproject(VssProjectInfo parentInfo)
        {
            var project = this;

            while (project != null)
            {
                if (project == parentInfo)
                {
                    return(true);
                }
                project = project.parentInfo;
            }
            return(false);
        }
Exemple #5
0
 public void RemoveProject(VssProjectInfo project)
 {
     projects.Remove(project);
 }
Exemple #6
0
 public void AddProject(VssProjectInfo project)
 {
     projects.Add(project);
 }
Exemple #7
0
 public bool IsSameOrSubproject(VssProjectInfo parentInfo)
 {
     var project = this;
     while (project != null)
     {
         if (project == parentInfo)
         {
             return true;
         }
         project = project.parentInfo;
     }
     return false;
 }
Exemple #8
0
 private VssProjectInfo GetOrCreateProject(VssItemName name)
 {
     VssProjectInfo projectInfo;
     if (!projectInfos.TryGetValue(name.PhysicalName, out projectInfo))
     {
         projectInfo = new VssProjectInfo(name.PhysicalName, name.LogicalName);
         projectInfos[name.PhysicalName] = projectInfo;
     }
     return projectInfo;
 }
Exemple #9
0
 public void SetProjectPath(string project, string path, string originalVssPath)
 {
     var projectInfo = new VssProjectInfo(project, path);
     projectInfo.IsRoot = true;
     projectInfo.OriginalVssPath = originalVssPath;
     projectInfos[project] = projectInfo;
     rootInfos[project] = projectInfo;
 }
Exemple #10
0
 public void RemoveProject(VssProjectInfo project)
 {
     projects.Remove(project);
 }
Exemple #11
0
 public void AddProject(VssProjectInfo project)
 {
     projects.Add(project);
 }