Ejemplo n.º 1
0
        internal ErrorHighLightTagger(ErrorHighLightChecker errorChecker)
        {
            _errorChecker = errorChecker;
            _errors       = errorChecker.LastError;

            errorChecker.AddTagger(this);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
        public ErrorFactory(ErrorHighLightChecker errorChecker, ErrorSnapShot errors)
        {
            _errorChecker = errorChecker;

            this.CurrentSnapshot = errors;
        }
Ejemplo n.º 6
0
 internal void RemoveErrorChecker(ErrorHighLightChecker errorChecker)
 {
     _sink.RemoveFactory(errorChecker._factory);
 }
Ejemplo n.º 7
0
 internal void AddErrorChecker(ErrorHighLightChecker spellChecker)
 {
     _sink.AddFactory(spellChecker._factory);
 }