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

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