Table of Contents

Class ControlRenderingHelpers

Namespace
SharpConsoleUI.Helpers
Assembly
SharpConsoleUI.dll

Shared rendering utilities for controls to avoid code duplication. Pass Transparent as background to preserve whatever is already in the buffer (gradient, parent background, etc.).

public static class ControlRenderingHelpers
Inheritance
ControlRenderingHelpers
Inherited Members

Methods

FillBottomMargin(CharacterBuffer, LayoutRect, LayoutRect, int, Color, Color)

Fills the bottom margin rows (from endY to bounds.Bottom) with spaces.

public static void FillBottomMargin(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, int endY, Color foreground, Color background)

Parameters

buffer CharacterBuffer
bounds LayoutRect
clipRect LayoutRect
endY int
foreground Color
background Color

FillHorizontalMargins(CharacterBuffer, LayoutRect, LayoutRect, int, int, int, Color, Color)

Fills the left and right horizontal margin columns on a single row with spaces.

public static void FillHorizontalMargins(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, int y, int contentStartX, int contentWidth, Color foreground, Color background)

Parameters

buffer CharacterBuffer
bounds LayoutRect
clipRect LayoutRect
y int
contentStartX int
contentWidth int
foreground Color
background Color

FillLineCharacter(CharacterBuffer, LayoutRect, LayoutRect, char, Color, Color)

Fills a single horizontal row with the given character, clipped to clipRect.

public static void FillLineCharacter(CharacterBuffer buffer, LayoutRect rect, LayoutRect clipRect, char lineChar, Color lineColor, Color background)

Parameters

buffer CharacterBuffer
rect LayoutRect
clipRect LayoutRect
lineChar char
lineColor Color
background Color

FillRect(CharacterBuffer, LayoutRect, Color, Color)

Fills the entire rect with spaces using the given colors.

public static void FillRect(CharacterBuffer buffer, LayoutRect rect, Color foreground, Color background)

Parameters

buffer CharacterBuffer
rect LayoutRect
foreground Color
background Color

FillTopMargin(CharacterBuffer, LayoutRect, LayoutRect, int, Color, Color)

Fills the top margin rows (from bounds.Y up to startY) with spaces.

public static void FillTopMargin(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, int startY, Color foreground, Color background)

Parameters

buffer CharacterBuffer
bounds LayoutRect
clipRect LayoutRect
startY int
foreground Color
background Color