コード例 #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
ファイル: Workspace.cs プロジェクト: SkightTeam/roslyn
 /// <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
ファイル: Workspace.cs プロジェクト: SkightTeam/roslyn
 /// <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
ファイル: Workspace.cs プロジェクト: SkightTeam/roslyn
 /// <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
ファイル: Workspace.cs プロジェクト: SkightTeam/roslyn
 protected virtual void CheckProjectCanBeRemoved(ProjectId projectId)
 {
     CheckProjectDoesNotContainOpenDocuments(projectId);
 }
コード例 #10
0
ファイル: Workspace.cs プロジェクト: SkightTeam/roslyn
 /// <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
ファイル: Workspace.cs プロジェクト: SkightTeam/roslyn
        /// <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)));
            }
        }