public TeXCommentTagger(ITextBuffer buffer) { this.buffer = buffer; tagsPerVersion = new TextSnapshotValuesPerVersionCache <PooledStructEnumerable <ITagSpan <TeXCommentTag> > >(GenerateAllTags); texCommentBlocks = TextSnapshotTeXCommentBlocksProvider.Get(buffer); //buffer.Changed += (sender, args) => HandleBufferChanged(args); }
internal TeXSyntaxClassifier(ITextBuffer buffer, IClassificationTypeRegistryService registry) { this.buffer = buffer; this.classificationTypeRegistry = registry; texCommentBlocks = TextSnapshotTeXCommentBlocksProvider.Get(buffer); commandClassificationType = classificationTypeRegistry.GetClassificationType("TeX.command"); mathBlockClassificationType = classificationTypeRegistry.GetClassificationType("TeX.mathBlock"); }
protected IntraTextAdornmentTagger(IWpfTextView textView) { this.TextView = textView; Snapshot = textView.TextBuffer.CurrentSnapshot; TexCommentBlocks = TextSnapshotTeXCommentBlocksProvider.Get(textView.TextBuffer); //this.view.LayoutChanged += HandleLayoutChanged; this.TextView.TextBuffer.Changed += HandleBufferChanged; ((FrameworkElement)textView).Loaded += TextView_Loaded; perSnapshotResults = new TextSnapshotValuesPerVersionCache <PooledStructEnumerable <ITagSpan <IntraTextAdornmentTag> > >(GetAdornmentTagsOnSnapshot); }
public virtual void Dispose() { ((FrameworkElement)TextView).Loaded -= TextView_Loaded; TextSnapshotTeXCommentBlocksProvider.Release(TextView.TextBuffer, TexCommentBlocks); perSnapshotResults.Dispose(); foreach (var item in adornmentsCache.Values) { item.Dispose(); } adornmentsCache.Clear(); }
public void Dispose() { if (isDisposed) { return; } try { TextSnapshotTeXCommentBlocksProvider.Release(buffer, texCommentBlocks); } finally { isDisposed = true; } }