Main editor document for the R language
상속: IREditorDocument
예제 #1
0
        public ROutliningTagger(REditorDocument document)
            : base(document.EditorTree.TextBuffer, new ROutlineRegionBuilder(document))
        {
            document.DocumentClosing += OnDocumentClosing;

            ServiceManager.AddService<ROutliningTagger>(this, document.EditorTree.TextBuffer);
        }
        private void HandleAddRemoveBuffers(ReadOnlyCollection<ITextBuffer> addedBuffers, ReadOnlyCollection<ITextBuffer> removedBuffers) {
            foreach (ITextBuffer tb in addedBuffers) {
                if (tb.ContentType.IsOfType(RContentTypeDefinition.ContentType)) {
                    IREditorDocument doc = REditorDocument.TryFromTextBuffer(tb);
                    if (doc == null) {
                        var editorDocument = new REditorDocument(tb);
                    }
                }
            }

            foreach (ITextBuffer tb in removedBuffers) {
                if (tb.ContentType.IsOfType(RContentTypeDefinition.ContentType)) {
                    IREditorDocument doc = REditorDocument.TryFromTextBuffer(tb);
                    if (doc != null) {
                        doc.Close();
                    }
                }
            }
        }