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
TextAlignmentThe alignment of the Text element.
placement
PlacementThe 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
Lines
Gets the text of the Text element.
public List<string> Lines { get; }
Property Value
Placement
Gets the position of the Text element.
public override Placement Placement { get; }
Property Value
TextAlignment
Gets the alignment of the Text element.
public override TextAlignment TextAlignment { get; }
Property Value
TextToDisplay
Gets the text to display.
public List<string>? TextToDisplay { get; }
Property Value
Width
Gets the width of the Text element.
public override int Width { get; }
Property Value
Methods
AddLine(string)
Adds a line to the Text element.
public void AddLine(string line)
Parameters
line
stringThe 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
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
intThe 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
stringThe 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
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
PlacementThe 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
TextAlignmentThe new alignment of the Text element.
Remarks
For more information, consider visiting the documentation available here.