Ejemplo n.º 1
0
 public RegexTagger(ITextBuffer buffer, IClassificationTypeRegistryService classificationTypeRegistryService)
 {
     m_buffer = buffer ?? throw new ArgumentNullException(nameof(buffer));
     m_classificationTypeRegistryService = classificationTypeRegistryService ?? throw new ArgumentNullException(nameof(classificationTypeRegistryService));
     m_storage = new VersionTrackingTagger <CaptureTag>(buffer);
     m_keys    = new String[] {
         Group01.Name,
         Group02.Name,
         Group03.Name,
         Group04.Name,
         Group05.Name,
         Group06.Name,
         Group07.Name,
     };
 }
        public HighlightTagger(
            IWpfTextView view,
            IClassificationFormatMap classificationFormatMap,
            IClassificationTypeRegistryService classificationTypeRegistryService)
        {
            m_view = view ?? throw new ArgumentNullException(nameof(view));
            m_classificationFormatMap           = classificationFormatMap ?? throw new ArgumentNullException(nameof(classificationFormatMap));
            m_classificationTypeRegistryService = classificationTypeRegistryService ?? throw new ArgumentNullException(nameof(classificationTypeRegistryService));
            m_storage = new VersionTrackingTagger <ITag>(m_view.TextBuffer);

            m_view.LayoutChanged += HandleLayoutChanged;
            m_view.Closed        += HandleViewClosed;
            m_classificationFormatMap.ClassificationFormatMappingChanged += ClassificationFormatMap_ClassificationFormatMappingChanged;

            UpdateViewLayoutOptionsCache(m_view.VisualElement);
        }