Exemple #1
0
        /// <summary>
        /// Opens an existing document.
        /// </summary>
        public DocumentId OpenDocument(SourceTextContainer sourceTextContainer, DocumentId documentId, Action <DiagnosticsUpdatedArgs> onDiagnosticsUpdated)
        {
            if (documentId != null && CurrentSolution.ContainsDocument(documentId) && !IsDocumentOpen(documentId))
            {
                if (CurrentSolution.ContainsDocument(documentId) && !IsDocumentOpen(documentId))
                {
                    OnDocumentOpened(documentId, sourceTextContainer);
                    OnDocumentContextUpdated(documentId);
                }

                if (onDiagnosticsUpdated != null)
                {
                    diagnosticsUpdatedNotifiers.TryAdd(documentId, onDiagnosticsUpdated);
                }

                return(documentId);
            }

            return(null);
        }