Ejemplo n.º 1
0
        void textView_GotAggregateFocus(object sender, EventArgs e)
        {
            var view = sender as ITextView;

            if (Taggers.ContainsKey(view))
            {
                CurrentTagger = Taggers[view];
            }
        }
Ejemplo n.º 2
0
        public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag
        {
            if (textView.TextBuffer != buffer)
            {
                return(null);
            }

            if (Taggers.ContainsKey(textView))
            {
                CurrentTagger = Taggers[textView];
            }
            else
            {
                ITextStructureNavigator textStructureNavigator = TextStructureNavigatorSelector.GetTextStructureNavigator(buffer);
                CurrentTagger = new FindWordTagger(textView, buffer, TextSearchService, textStructureNavigator);
                Taggers.Add(textView, CurrentTagger);
                textView.GotAggregateFocus += textView_GotAggregateFocus;
                textView.Closed            += textView_Closed;
            }

            return(CurrentTagger as ITagger <T>);
        }