Пример #1
0
 internal ProjectState GetProjectState(ProjectId projectId) => _state.GetProjectState(projectId);
Пример #2
0
 /// <summary>
 /// True if the solution contains a project with the specified project ID.
 /// </summary>
 public bool ContainsProject(ProjectId projectId) => _state.ContainsProject(projectId);
Пример #3
0
        /// <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));
        }
Пример #4
0
 /// <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)));
 }
Пример #5
0
 /// <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();
 }
Пример #6
0
 private static Project CreateProject(ProjectId projectId, Solution solution)
 {
     return(new Project(solution, solution.State.GetProjectState(projectId)));
 }
Пример #7
0
 /// <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();
 }
Пример #8
0
 /// <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();
 }
Пример #9
0
 protected virtual void CheckProjectCanBeRemoved(ProjectId projectId)
 {
     CheckProjectDoesNotContainOpenDocuments(projectId);
 }
Пример #10
0
 /// <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);
 }
Пример #11
0
        /// <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)));
            }
        }