Table of Contents

Class LineBackgroundRenderer

Namespace
Loehnert.Lisrt.Scripting.Editor.Controls
Assembly
Loehnert.Lisrt.Scripting.dll

Renderer for changing the background of a ICSharpCode.AvalonEdit.Rendering.TextView.

public class LineBackgroundRenderer : IBackgroundRenderer
Inheritance
LineBackgroundRenderer
Implements
IBackgroundRenderer
Inherited Members

Examples

  _lineBackgroundRenderer = new LineBackgroundRenderer(this, Brushes.Green);
  _view.TextEditor.TextArea.TextView.BackgroundRenderers.Add(_lineBackgroundRenderer);

private static void UpdateLineBackgroundRenderer(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
{
    // PropertyChangedCallback of the depending DependencyProperty
    var codeEditor = sender as CodeEditor;
    codeEditor._executingLineBackgroundRenderer.Line = codeEditor.ExecutingLine;
    codeEditor._calledLineBackgroundRenderer.Line = codeEditor.CalledLine;
    codeEditor.TextArea.TextView.InvalidateLayer(KnownLayer.Selection);
}

Constructors

LineBackgroundRenderer(TextEditor, SolidColorBrush)

Initializes a new instance of the LineBackgroundRenderer class.

public LineBackgroundRenderer(TextEditor editor, SolidColorBrush color)

Parameters

editor TextEditor

Text editor.

color SolidColorBrush

Color for the line.

Properties

Layer

Gets the layer on which this background renderer should draw.

public KnownLayer Layer { get; }

Property Value

KnownLayer

Line

Gets or sets the colorized line.

public int Line { get; set; }

Property Value

int

Methods

Draw(TextView, DrawingContext)

Causes the background renderer to draw.

public void Draw(TextView textView, DrawingContext drawingContext)

Parameters

textView TextView

View with the text.

drawingContext DrawingContext

Context for drawing.