public void RemoveTagger(LintTagger tagger) { _activeTaggers.Remove(tagger); if (RefCount == 0) { Dispose(); } }
public void AddTagger(LintTagger tagger) { if (RefCount == 0) { Initialize(); RunLinter(); } _activeTaggers.Add(tagger); }
/// <summary> /// Create a tagger that does lint checking on the view/buffer combination. /// </summary> public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag { ITagger <T> tagger = null; // Only attempt to lint check on the view's edit buffer (and multiple views could have that buffer open simultaneously so // only create one instance of the lint checker. if ((buffer == textView.TextBuffer) && (typeof(T) == typeof(IErrorTag))) { var lintChecker = buffer.Properties.GetOrCreateSingletonProperty(typeof(LintChecker), () => new LintChecker(this, textView, buffer)); // This is a thin wrapper around the LintChecker that can be disposed of without shutting down the LintChecker // (unless it was the last tagger on the lint checker). tagger = new LintTagger(lintChecker) as ITagger <T>; } return(tagger); }