internal Tuple<int, Project> Add(ProjectViewModel project) { var pid = _workspace.AddProject(project.Name, "C#"); var proj = _workspace.CurrentSolution.GetProject(pid); int id = Interlocked.Increment(ref _projectsIds); if (!_contexts.TryAdd(id, project)) throw new Exception("Id already taken"); if (_host.IsConnected) _host.InitProject(id, project.Path); return new Tuple<int, Project>(id, proj); }
public static FolderViewModel Get(FolderViewModel parent, DirectoryInfo dir) { FolderViewModel ret; if (dir.Name == "packages" && parent is WorkspaceViewModel) { ret = new PackagesViewModel(parent, dir, true); } else if (dir.GetFiles("project.json", SearchOption.TopDirectoryOnly).Length == 1) { ret = new ProjectViewModel(parent, dir); } else { ret = new FolderViewModel(parent, dir); } ret.Initialize(); return(ret); }
public ReferencesViewModel(ProjectViewModel project) : base(project) { }
public static FolderViewModel Get(FolderViewModel parent, DirectoryInfo dir) { FolderViewModel ret; if (dir.Name == "packages" && parent is WorkspaceViewModel) ret = new PackagesViewModel(parent, dir, true); else if (dir.GetFiles("project.json", SearchOption.TopDirectoryOnly).Length == 1) ret = new ProjectViewModel(parent, dir); else ret = new FolderViewModel(parent, dir); ret.Initialize(); return ret; }
public ReferencesViewModel(ProjectViewModel project) : base(project) { }