Represents the current state of a VSS project.
Inheritance: VssItemInfo
        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);
        }
        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;
        }
        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);
        }
        public bool IsSameOrSubproject(VssProjectInfo parentInfo)
        {
            var project = this;

            while (project != null)
            {
                if (project == parentInfo)
                {
                    return(true);
                }
                project = project.parentInfo;
            }
            return(false);
        }
Exemple #5
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 #6
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 #7
0
 public void RemoveProject(VssProjectInfo project)
 {
     projects.Remove(project);
 }
Exemple #8
0
 public void AddProject(VssProjectInfo project)
 {
     projects.Add(project);
 }
Exemple #9
0
 public bool IsSameOrSubproject(VssProjectInfo parentInfo)
 {
     var project = this;
     while (project != null)
     {
         if (project == parentInfo)
         {
             return true;
         }
         project = project.parentInfo;
     }
     return false;
 }
 public void RemoveProject(VssProjectInfo project)
 {
     projects.Remove(project);
 }
 public void AddProject(VssProjectInfo project)
 {
     projects.Add(project);
 }