// get the FolderComposite object representing the the project's folder 'targetFolder'. Build the needed FolderComposite(s) for a complete path private CsharpFolderComposite GetOrBuildFolderComposite(IDictionary <string, CsharpFolderComposite> cache, string targetFolder, string projectUnderTestDir, ProjectComponent <SyntaxTree> inputFiles) { if (cache.ContainsKey(targetFolder)) { return(cache[targetFolder]); } var folder = targetFolder; CsharpFolderComposite subDir = null; while (!string.IsNullOrEmpty(folder)) { if (!cache.ContainsKey(folder)) { // we have not scanned this folder yet var fullPath = FileSystem.Path.Combine(projectUnderTestDir, folder); var newComposite = new CsharpFolderComposite { FullPath = fullPath, RelativePath = Path.GetRelativePath(projectUnderTestDir, fullPath), }; if (subDir != null) { newComposite.Add(subDir); } cache.Add(folder, newComposite); subDir = newComposite; folder = Path.GetDirectoryName(folder); if (string.IsNullOrEmpty(folder)) { // we are at root var root = inputFiles as IReadOnlyFolderComposite; root.Add(subDir); } } else { cache[folder].Add(subDir); break; } } return(cache[targetFolder]); }
/// <summary> /// The panel refreshes everytime it was reloaded, to call the method CheckBeforeClick. /// </summary> public void RefreshDisplay() { localProject = orchestrator.GetComponent <Orchestrator.Orchestrator>().GetLocalProject(); CheckBeforeClick(); }
/// <summary> /// Sets the tree to null /// </summary> public void DeleteTree() { project = null; }
/// <summary> /// Sets the root of the project tree e.g. if a tree is read from disk /// </summary> /// <param name="tree">Root of the project tree</param> public void SetTree(ProjectComponent tree) { project = tree; }
public void RemoveProjectComponent(ProjectComponent model) { Context.ProjectComponents.Remove(model); }
public ProjectController(ProjectComponent component) { this.component = component; }
public ProjectController() { component = new ProjectComponent(new DataContext()); }