internal ProjectState GetProjectState(ProjectId projectId) => _state.GetProjectState(projectId);
/// <summary> /// True if the solution contains a project with the specified project ID. /// </summary> public bool ContainsProject(ProjectId projectId) => _state.ContainsProject(projectId);
/// <summary> /// Creates a new solution instance that includes a project with the specified language and names. /// Returns the new project. /// </summary> public Project AddProject(string name, string assemblyName, string language) { var id = ProjectId.CreateNewId(debugName: name); return(this.AddProject(id, name, assemblyName, language).GetProject(id)); }
/// <summary> /// Creates a new solution instance that includes a project with the specified language and names. /// </summary> public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language) { return(this.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), name, assemblyName, language))); }
/// <summary> /// This method is called during ApplyChanges to remove an analyzer reference from a project. /// /// Override this method to implement the capability of removing analyzer references. /// </summary> protected virtual void RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) { throw new NotSupportedException(); }
private static Project CreateProject(ProjectId projectId, Solution solution) { return(new Project(solution, solution.State.GetProjectState(projectId))); }
/// <summary> /// This method is called during ApplyChanges to remove a metadata reference from a project. /// /// Override this method to implement the capability of removing metadata references. /// </summary> protected virtual void RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference) { throw new NotSupportedException(); }
/// <summary> /// This method is called during ApplyChanges to remove a project reference from a project. /// /// Override this method to implement the capability of removing project references. /// </summary> protected virtual void RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) { throw new NotSupportedException(); }
protected virtual void CheckProjectCanBeRemoved(ProjectId projectId) { CheckProjectDoesNotContainOpenDocuments(projectId); }
/// <summary> /// This method is called when an individual project is removed. /// /// Override this method if you want to do additional work when a project is removed. /// Call the base method at the end of your method. /// </summary> protected virtual void ClearProjectData(ProjectId projectId) { this.ClearOpenDocuments(projectId); }
/// <summary> /// Throws an exception if project has a transitive reference to another project. /// </summary> protected void CheckProjectDoesNotHaveTransitiveProjectReference(ProjectId fromProjectId, ProjectId toProjectId) { var transitiveReferences = GetTransitiveProjectReferences(toProjectId); if (transitiveReferences.Contains(fromProjectId)) { throw new ArgumentException(string.Format( WorkspacesResources.CausesCircularProjectReference, this.GetProjectName(fromProjectId), this.GetProjectName(toProjectId))); } }