public IWpfTextViewMargin CreateMargin(IWpfTextViewHost view_host, IWpfTextViewMargin container_margin) { IWpfTextView text_view = view_host.TextView; try { Utils.VSVersion = Assembly.GetCallingAssembly().GetName().Version.Major.ToString(); } catch { } if (!PresenceSent) { PresenceSent = true; MonitoringService.SendPresense(); } if (!SettingsLoaded) { ReadSettings(OptionsService.GlobalOptions); } RemoveVerticalScrollBar(container_margin); var navigator = TextStructureNavigatorService.GetTextStructureNavigator(text_view.TextBuffer); var format = FormatMapService.GetEditorFormatMap(text_view); var tagger = HighlightWordTagger.Instance(text_view, format, TextSearchService, navigator); var marks_enumerator = new MarksEnumerator(AggregatorFactoryService, text_view); var change_enumerator = new ChangeEnumerator(AggregatorFactoryService, text_view); var words_enumerator = new HighlightedWordsEnumerator(text_view, tagger); return(new RockMargin(text_view, marks_enumerator, change_enumerator, words_enumerator, tagger)); }
public ITagger <T> CreateTagger <T>(ITextView view, ITextBuffer buffer) where T : ITag { // provide highlighting only on the top buffer if (view.TextBuffer != buffer) { return(null); } var navigator = TextStructureNavigatorService.GetTextStructureNavigator(buffer); var format = FormatMapService.GetEditorFormatMap(view); return(HighlightWordTagger.Instance(view as IWpfTextView, format, TextSearchService, navigator) as ITagger <T>); }