Table of Contents

Class LineNumberGutterRenderer

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Built-in gutter renderer that displays source line numbers. Highlights the current line number using the control's foreground color.

public class LineNumberGutterRenderer : IGutterRenderer
Inheritance
LineNumberGutterRenderer
Implements
Inherited Members
Extension Methods

Properties

LineNumberColor

Gets or sets the foreground color for line numbers. When null, defaults to Grey. The current-line number always uses the context's foreground color for emphasis.

public Color LineNumberColor { get; set; }

Property Value

Color

Padding

Gets or sets the right-side padding in columns after the line number digits. Defaults to LineNumberGutterPadding.

public int Padding { get; set; }

Property Value

int

Methods

GetWidth(int)

Returns the width in columns that this renderer needs for the given document. Called once per paint pass; the sum of all renderer widths determines the total gutter width.

public int GetWidth(int totalLineCount)

Parameters

totalLineCount int

The total number of source lines in the document.

Returns

int

Render(in GutterRenderContext, int)

Renders a single row of the gutter.

public void Render(in GutterRenderContext context, int width)

Parameters

context GutterRenderContext

The rendering context for this row.

width int

The column width allocated to this renderer (from GetWidth(int)).