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); }
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 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; }
public void RemoveProject(VssProjectInfo project) { projects.Remove(project); }
public void AddProject(VssProjectInfo project) { projects.Add(project); }
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); }