static internal bool ToggleWord(string word)
        {
            if (!IsValidWord(word))
            {
                throw new ArgumentOutOfRangeException(
                          "column", "The string must contain only one nonempty word.");
            }
            var words = HighlightWordsSettingsManager.GetWords();

            if (words.Contains(word))
            {
                // Remove the word.
                words.Remove(word);
            }
            else
            {
                if (words.Count() >= _maxWords)
                {
                    return(false);
                }
                words.Add(word);
            }
            WriteSettings(words);
            return(true);
        }
        void UpdateWordsAdornments()
        {
            SnapshotPoint currentRequest = RequestedPoint;
            List <NormalizedSnapshotSpanCollection> wordSpansList = new List <NormalizedSnapshotSpanCollection>();
            var words = HighlightWordsSettingsManager.GetWords();

            foreach (string word in words)
            {
                //Find the new spans
                FindData findData = new FindData(word, SourceBuffer.CurrentSnapshot)
                {
                    FindOptions = FindOptions.WholeWord | FindOptions.MatchCase
                };

                wordSpansList.Add(new NormalizedSnapshotSpanCollection(TextSearchService.FindAll(findData)));
            }

            //If another change hasn't happened, do a real update
            if (currentRequest == RequestedPoint)
            {
                SynchronousUpdate(currentRequest, wordSpansList);
            }
        }