protected override ITextMarker CreateMarker(ITextMarkerService markerService)
        {
            IDocumentLine line        = this.Document.GetLineByNumber(this.LineNumber);
            ITextMarker   marker      = markerService.Create(line.Offset, line.Length);
            IHighlighter  highlighter = this.Document.GetService(typeof(IHighlighter)) as IHighlighter;

            marker.BackgroundColor = BookmarkBase.BreakpointDefaultBackground;
            marker.ForegroundColor = BookmarkBase.BreakpointDefaultForeground;
            marker.MarkerColor     = BookmarkBase.BreakpointDefaultBackground;
            marker.MarkerTypes     = TextMarkerTypes.CircleInScrollBar;

            if (highlighter != null)
            {
                var color = highlighter.GetNamedColor(BookmarkBase.BreakpointMarkerName);
                if (color != null)
                {
                    marker.BackgroundColor = color.Background.GetColor(null);
                    marker.MarkerColor     = color.Background.GetColor(null) ?? BookmarkBase.BreakpointDefaultForeground;
                    marker.ForegroundColor = color.Foreground.GetColor(null);
                }
            }
            return(marker);
        }
Beispiel #2
0
        protected override ITextMarker CreateMarker(ITextMarkerService markerService)
        {
            IDocumentLine sLine       = this.Document.GetLineByNumber(startLine);
            IDocumentLine eLine       = this.Document.GetLineByNumber(endLine);
            int           sOffset     = Math.Min(sLine.Offset + startColumn - 1, sLine.EndOffset);
            int           eOffset     = Math.Min(eLine.Offset + endColumn - 1, eLine.EndOffset);
            ITextMarker   marker      = markerService.Create(sOffset, Math.Max(eOffset - sOffset, 1));
            IHighlighter  highlighter = this.Document.GetService(typeof(IHighlighter)) as IHighlighter;

            marker.BackgroundColor = BookmarkBase.CurrentLineDefaultBackground;
            marker.ForegroundColor = BookmarkBase.CurrentLineDefaultForeground;

            if (highlighter != null)
            {
                var color = highlighter.GetNamedColor(BookmarkBase.CurrentLineBookmarkName);
                if (color != null)
                {
                    marker.BackgroundColor = color.Background.GetColor(null);
                    marker.ForegroundColor = color.Foreground.GetColor(null);
                }
            }
            return(marker);
        }