private FileModelEntry <Project> AddProjectEntry(string projectDirectory, FileModelEntry <Project> currentEntry) { if (currentEntry == null) { currentEntry = new FileModelEntry <Project>(); } else if (!File.Exists(Path.Combine(projectDirectory, Project.FileName))) { // project was deleted currentEntry.Reset(); return(currentEntry); } if (currentEntry.IsInvalid) { Project project; if (!ProjectReader.TryGetProject(projectDirectory, out project, currentEntry.Diagnostics)) { currentEntry.Reset(); } else { currentEntry.Model = project; currentEntry.FilePath = project.ProjectFilePath; currentEntry.UpdateLastWriteTimeUtc(); } } return(currentEntry); }
private static Project ResolveProject(string projectDirectory) { Project project; if (ProjectReader.TryGetProject(projectDirectory, out project)) { return(project); } else { return(null); } }
private Project ResolveProject(string projectDirectory) { Project project; if (ProjectReader.TryGetProject(projectDirectory, out project, settings: ProjectReaderSettings)) { return(project); } else { return(null); } }
private Project ResolveProject(string projectDirectory) { // TODO: Handle diagnostics Project project; if (ProjectReader.TryGetProject(projectDirectory, out project, diagnostics: null, settings: Settings)) { return(project); } else { return(null); } }
private void EnsureProjectLoaded() { if (Project == null) { Project project; if (ProjectReader.TryGetProject(ProjectDirectory, out project)) { Project = project; } else { throw new InvalidOperationException($"Unable to resolve project from {ProjectDirectory}"); } } }