Abc.NCrafts.App.Views.LineHighlighterBackgroundRenderer.Draw C# (CSharp) Method

Draw() public method

public Draw ( TextView textView, System.Windows.Media.DrawingContext drawingContext ) : void
textView TextView
drawingContext System.Windows.Media.DrawingContext
return void
        public void Draw(TextView textView, DrawingContext drawingContext)
        {
            textView.EnsureVisualLines();

            foreach (var lineToHighlight in HighlightedLines.Where(i => textView.Document.LineCount >= i))
            {
                if (lineToHighlight <= 0)
                    continue;

                foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, textView.Document.GetLineByNumber(lineToHighlight), true))
                {
                    drawingContext.DrawRectangle(new SolidColorBrush(Color.FromArgb(100, 255, 184, 0)), null, new Rect(rect.Location, new Size(textView.ActualWidth, rect.Height)));
                }
            }
        }
    }
LineHighlighterBackgroundRenderer