private void RunningDocTableEventsOnDocumentLoaded(object sender, DocumentLoadedEventArgs e) { var document = TextDocumentFromTextBuffer(e.TextBuffer); if (document == null) { Logger.LogInfo("Ignoring 'document loaded' event because the is no ITextDocument available: \"{0}\"", e.Path); return; } // Add to table (before invoking handlers). Note that this handler can be called // for both initial loading, as well as any reloading from disk. We want to call handlers // only once. bool added = false; lock (_openDocumentsLock) { if (!_openDocuments.ContainsKey(e.Path)) { _openDocuments[e.Path] = document; added = true; } } if (added) { OnTextDocumentOpened(new TextDocumentEventArgs(e.Path, document)); } }
protected virtual void OnDocumentLoaded(DocumentLoadedEventArgs e) { DocumentLoaded?.Invoke(this, e); }