internal ErrorHighLightTagger(ErrorHighLightChecker errorChecker) { _errorChecker = errorChecker; _errors = errorChecker.LastError; errorChecker.AddTagger(this); }
/// <summary> /// Create a tagger that does error 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 spell check on the view's edit buffer (and multiple views could have that buffer open simultaneously so // only create one instance of the spell checker. if ((buffer == textView.TextBuffer) && (typeof(T) == typeof(IErrorTag))) { ErrorHighLightChecker errorChecker = buffer.Properties.GetOrCreateSingletonProperty(typeof(ErrorHighLightChecker), () => new ErrorHighLightChecker(this, textView, buffer)); tagger = new ErrorHighLightTagger(errorChecker) as ITagger <T>; } return(tagger); }
public void RemoveSpellChecker(ErrorHighLightChecker errorChecker) { // This call will always happen on the UI thread (it is a side-effect of adding or removing the 1st/last tagger). lock (_managers) { _errorCheckers.Remove(errorChecker); foreach (var manager in _managers) { manager.RemoveErrorChecker(errorChecker); } } }
public void AddSpellChecker(ErrorHighLightChecker errorChecker) { // This call will always happen on the UI thread (it is a side-effect of adding or removing the 1st/last tagger). lock (_managers) { _errorCheckers.Add(errorChecker); // Tell the preexisting managers about the new spell checker foreach (var manager in _managers) { manager.AddErrorChecker(errorChecker); } } }
public ErrorFactory(ErrorHighLightChecker errorChecker, ErrorSnapShot errors) { _errorChecker = errorChecker; this.CurrentSnapshot = errors; }
internal void RemoveErrorChecker(ErrorHighLightChecker errorChecker) { _sink.RemoveFactory(errorChecker._factory); }
internal void AddErrorChecker(ErrorHighLightChecker spellChecker) { _sink.AddFactory(spellChecker._factory); }