예제 #1
0
        private void RunningDocTableEventsOnDocumentClosed(object sender, VsDocumentEventArgs e)
        {
            var path = e.Path;
            var info = _runningDocumentTable.GetDocumentInfo(path.Value);

            // Call handlers
            var document = GetTextDocument(info);

            if (document != null)
            {
                OnTextDocumentClosed(new TextDocumentEventArgs(document));
            }

            // Remove from table
            lock (_openDocumentsLock) {
                _openDocuments.Remove(path);
            }
        }
예제 #2
0
        private void RunningDocTableEventsOnDocumentOpened(object sender, VsDocumentEventArgs e)
        {
            var path = e.Path;
            var info = _runningDocumentTable.GetDocumentInfo(path.Value);

            // Call handlers
            var document = GetTextDocument(info);

            if (document != null)
            {
                document.FileActionOccurred += TextDocumentOnFileActionOccurred;
                // Add to table
                lock (_openDocumentsLock) {
                    _openDocuments[path] = document;
                }
                // Call handlers
                OnTextDocumentOpened(new TextDocumentEventArgs(document));
            }
        }
예제 #3
0
 protected virtual void OnDocumentClosed(VsDocumentEventArgs e)
 {
     DocumentClosed?.Invoke(this, e);
 }