Table of Contents

Class Text

Namespace
ConsoleAppVisuals.PassiveElements
Assembly
ConsoleAppVisuals.dll

The Text is an passive element that displays one or multiple lines of text.

public class Text : PassiveElement
Inheritance
Text
Inherited Members

Remarks

For more information, consider visiting the documentation available here.

Constructors

Text(List<string>, TextAlignment, Placement)

The Text is an passive element that displays one or multiple lines of text.

public Text(List<string> lines, TextAlignment align = TextAlignment.Left, Placement placement = Placement.TopCenter)

Parameters

lines List<string>

The text to display.

align TextAlignment

The alignment of the Text element.

placement Placement

The placement of the Text element.

Remarks

For more information, consider visiting the documentation available here.

Properties

Height

Gets the height of the Text element.

public override int Height { get; }

Property Value

int

Lines

Gets the text of the Text element.

public List<string> Lines { get; }

Property Value

List<string>

Placement

Gets the position of the Text element.

public override Placement Placement { get; }

Property Value

Placement

TextAlignment

Gets the alignment of the Text element.

public override TextAlignment TextAlignment { get; }

Property Value

TextAlignment

TextToDisplay

Gets the text to display.

public List<string>? TextToDisplay { get; }

Property Value

List<string>

Width

Gets the width of the Text element.

public override int Width { get; }

Property Value

int

Methods

AddLine(string)

Adds a line to the Text element.

public void AddLine(string line)

Parameters

line string

The line to add.

Remarks

For more information, consider visiting the documentation available here.

InsertLine(int, string)

Inserts a line to the Text element.

public void InsertLine(int index, string line)

Parameters

index int

The index where to insert the line.

line string

The line to insert.

Remarks

For more information, consider visiting the documentation available here.

RemoveLine(int)

Removes a line from the Text element.

public void RemoveLine(int index)

Parameters

index int

The index of the line to remove.

Remarks

For more information, consider visiting the documentation available here.

RemoveLine(string)

Removes a line from the Text element.

public void RemoveLine(string line)

Parameters

line string

The line to remove.

Remarks

For more information, consider visiting the documentation available here.

RenderElementActions()

Defines the actions to perform when the element is called to be rendered on the console.

[Visual]
protected override void RenderElementActions()

UpdateLines(List<string>)

Updates the lines of the Text element.

public void UpdateLines(List<string> lines)

Parameters

lines List<string>

The new text of the Text element.

Remarks

For more information, consider visiting the documentation available here.

UpdatePlacement(Placement)

Updates the placement of the Text element.

public void UpdatePlacement(Placement newPlacement)

Parameters

newPlacement Placement

The new placement of the Text element.

Remarks

For more information, consider visiting the documentation available here.

UpdateTextAlignment(TextAlignment)

Updates the alignment of the Text element.

public void UpdateTextAlignment(TextAlignment newAlignment)

Parameters

newAlignment TextAlignment

The new alignment of the Text element.

Remarks

For more information, consider visiting the documentation available here.