Exemple #1
0
 /// <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
     );
Exemple #2
0
 /// <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
     );
Exemple #3
0
        public AnalyzerConfigDocument?GetAnalyzerConfigDocument(DocumentId documentId)
        {
            if (!ContainsAnalyzerConfigDocument(documentId))
            {
                return(null);
            }

            return(ImmutableHashMapExtensions.GetOrAdd(ref _idToAnalyzerConfigDocumentMap, documentId, s_createAnalyzerConfigDocumentFunction, this));
        }
Exemple #4
0
        public TextDocument?GetAdditionalDocument(DocumentId documentId)
        {
            if (!ContainsAdditionalDocument(documentId))
            {
                return(null);
            }

            return(ImmutableHashMapExtensions.GetOrAdd(ref _idToAdditionalDocumentMap, documentId, s_createAdditionalDocumentFunction, this));
        }
Exemple #5
0
        /// <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));
        }
Exemple #6
0
        /// <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);
        }
Exemple #7
0
        /// <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);
        }