GlyphTextViewMarkerService(IGlyphTextMarkerServiceImpl glyphTextMarkerServiceImpl, IWpfTextView wpfTextView) { if (glyphTextMarkerServiceImpl == null) { throw new ArgumentNullException(nameof(glyphTextMarkerServiceImpl)); } if (wpfTextView == null) { throw new ArgumentNullException(nameof(wpfTextView)); } this.onRemovedDelegate = OnRemoved; this.glyphTextMarkerServiceImpl = glyphTextMarkerServiceImpl; this.TextView = wpfTextView; this.markerLayer = wpfTextView.GetAdornmentLayer(PredefinedDnSpyAdornmentLayers.GlyphTextMarker); this.markerAndSpanCollection = new MarkerAndSpanCollection(); this.markerElements = new List <MarkerElement>(); this.editorFormatMap = glyphTextMarkerServiceImpl.EditorFormatMapService.GetEditorFormatMap(wpfTextView); this.glyphTextViewMarkerGlyphTagTagger = GlyphTextViewMarkerGlyphTagger.GetOrCreate(this); this.glyphTextViewMarkerGlyphTextMarkerTagTagger = GlyphTextViewMarkerGlyphTextMarkerTagger.GetOrCreate(this); this.glyphTextViewMarkerClassificationTagTagger = GlyphTextViewMarkerClassificationTagger.GetOrCreate(this); this.useReducedOpacityForHighContrast = wpfTextView.Options.GetOptionValue(DefaultWpfViewOptions.UseReducedOpacityForHighContrastOptionId); wpfTextView.Closed += WpfTextView_Closed; wpfTextView.LayoutChanged += WpfTextView_LayoutChanged; wpfTextView.Options.OptionChanged += Options_OptionChanged; glyphTextMarkerServiceImpl.MarkerAdded += GlyphTextMarkerServiceImpl_MarkerAdded; glyphTextMarkerServiceImpl.MarkerRemoved += GlyphTextMarkerServiceImpl_MarkerRemoved; glyphTextMarkerServiceImpl.MarkersRemoved += GlyphTextMarkerServiceImpl_MarkersRemoved; editorFormatMap.FormatMappingChanged += EditorFormatMap_FormatMappingChanged; }
GlyphTextViewMarkerService(IGlyphTextMarkerServiceImpl glyphTextMarkerServiceImpl, IWpfTextView wpfTextView) { if (glyphTextMarkerServiceImpl == null) throw new ArgumentNullException(nameof(glyphTextMarkerServiceImpl)); if (wpfTextView == null) throw new ArgumentNullException(nameof(wpfTextView)); onRemovedDelegate = OnRemoved; this.glyphTextMarkerServiceImpl = glyphTextMarkerServiceImpl; TextView = wpfTextView; markerLayer = wpfTextView.GetAdornmentLayer(PredefinedDsAdornmentLayers.GlyphTextMarker); markerAndSpanCollection = new MarkerAndSpanCollection(this); markerElements = new List<MarkerElement>(); editorFormatMap = glyphTextMarkerServiceImpl.EditorFormatMapService.GetEditorFormatMap(wpfTextView); glyphTextViewMarkerGlyphTagTagger = GlyphTextViewMarkerGlyphTagger.GetOrCreate(this); glyphTextViewMarkerGlyphTextMarkerTagTagger = GlyphTextViewMarkerGlyphTextMarkerTagger.GetOrCreate(this); glyphTextViewMarkerClassificationTagTagger = GlyphTextViewMarkerClassificationTagger.GetOrCreate(this); useReducedOpacityForHighContrast = wpfTextView.Options.GetOptionValue(DefaultWpfViewOptions.UseReducedOpacityForHighContrastOptionId); wpfTextView.Closed += WpfTextView_Closed; wpfTextView.LayoutChanged += WpfTextView_LayoutChanged; wpfTextView.Options.OptionChanged += Options_OptionChanged; glyphTextMarkerServiceImpl.MarkerAdded += GlyphTextMarkerServiceImpl_MarkerAdded; glyphTextMarkerServiceImpl.MarkerRemoved += GlyphTextMarkerServiceImpl_MarkerRemoved; glyphTextMarkerServiceImpl.MarkersRemoved += GlyphTextMarkerServiceImpl_MarkersRemoved; editorFormatMap.FormatMappingChanged += EditorFormatMap_FormatMappingChanged; }