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(); } } } }