/// <summary> /// Get the analyzer config document in this project with the specified document Id. /// </summary> public AnalyzerConfigDocument?GetAnalyzerConfigDocument(DocumentId documentId) => ImmutableHashMapExtensions.GetOrAdd( ref _idToAnalyzerConfigDocumentMap, documentId, s_tryCreateAnalyzerConfigDocumentFunction, this );
/// <summary> /// Get the additional document in this project with the specified document Id. /// </summary> public TextDocument?GetAdditionalDocument(DocumentId documentId) => ImmutableHashMapExtensions.GetOrAdd( ref _idToAdditionalDocumentMap, documentId, s_tryCreateAdditionalDocumentFunction, this );
public AnalyzerConfigDocument?GetAnalyzerConfigDocument(DocumentId documentId) { if (!ContainsAnalyzerConfigDocument(documentId)) { return(null); } return(ImmutableHashMapExtensions.GetOrAdd(ref _idToAnalyzerConfigDocumentMap, documentId, s_createAnalyzerConfigDocumentFunction, this)); }
public TextDocument?GetAdditionalDocument(DocumentId documentId) { if (!ContainsAdditionalDocument(documentId)) { return(null); } return(ImmutableHashMapExtensions.GetOrAdd(ref _idToAdditionalDocumentMap, documentId, s_createAdditionalDocumentFunction, this)); }
/// <summary> /// Get the document in this project with the specified document Id. /// </summary> public Document GetDocument(DocumentId documentId) { if (!ContainsDocument(documentId)) { return(null); } return(ImmutableHashMapExtensions.GetOrAdd(ref _idToDocumentMap, documentId, s_createDocumentFunction, this)); }
/// <summary> /// Gets the project in this solution with the specified project ID. /// /// If the id is not an id of a project that is part of this solution the method returns null. /// </summary> public Project GetProject(ProjectId projectId) { // ContainsProject checks projectId being null if (this.ContainsProject(projectId)) { return(ImmutableHashMapExtensions.GetOrAdd(ref _projectIdToProjectMap, projectId, s_createProjectFunction, this)); } return(null); }
/// <summary> /// Gets the project in this solution with the specified project ID. /// /// If the id is not an id of a project that is part of this solution the method returns null. /// </summary> public Project GetProject(ProjectId projectId) { if (projectId == null) { throw new ArgumentNullException(nameof(projectId)); } if (this.ContainsProject(projectId)) { return(ImmutableHashMapExtensions.GetOrAdd(ref _projectIdToProjectMap, projectId, s_createProjectFunction, this)); } return(null); }