Table of Contents

Class Dialog

Namespace
ConsoleAppVisuals.InteractiveElements
Assembly
ConsoleAppVisuals.dll

The Dialog is an interactive element that displays a dialog bow with one or two choices. See DialogOption enum for the possible outputs of a dialog.

public class Dialog : InteractiveElement<DialogOption>
Inheritance
Dialog
Inherited Members

Remarks

For more information, consider visiting the documentation available here.

Constructors

Dialog(List<string>, string?, string?, TextAlignment, Placement, BordersType)

The Dialog is an interactive element that displays a dialog bow with one or two choices. See DialogOption enum for the possible outputs of a dialog.

public Dialog(List<string> lines, string? leftOption = null, string? rightOption = null, TextAlignment align = TextAlignment.Left, Placement placement = Placement.TopCenter, BordersType bordersType = BordersType.SingleStraight)

Parameters

lines List<string>

The text to display.

leftOption string

The text of the left option. Null for no button.

rightOption string

The text of the right option. Null for no button.

align TextAlignment

The alignment of the Dialog.

placement Placement

The placement of the Dialog element.

bordersType BordersType

The type of border to display.

Remarks

For more information, consider visiting the documentation available here.

Properties

Borders

Gets the borders of the Dialog.

public Borders Borders { get; }

Property Value

Borders

BordersType

Gets the border type of the selector.

public BordersType BordersType { get; }

Property Value

BordersType

Height

Gets the height of the Dialog.

public override int Height { get; }

Property Value

int

LeftOption

Gets the text of the left option.

public string? LeftOption { get; }

Property Value

string

Lines

Gets the rows of the Dialog.

public List<string> Lines { get; }

Property Value

List<string>

Placement

Gets the position of the Dialog.

public override Placement Placement { get; }

Property Value

Placement

RightOption

Gets the text of the right option.

public string? RightOption { get; }

Property Value

string

TextAlignment

Gets the alignment of the Dialog.

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 Dialog.

public override int Width { get; }

Property Value

int

Methods

AddLine(string)

Adds a line to the Dialog.

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 Dialog.

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 Dialog.

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 Dialog.

public void RemoveLine(string line)

Parameters

line string

The line to remove.

Remarks

For more information, consider visiting the documentation available here.

RenderElementActions()

Renders the Dialog.

[Visual]
protected override void RenderElementActions()

UpdateBordersType(BordersType)

Updates the borders of the Dialog.

public void UpdateBordersType(BordersType bordersType)

Parameters

bordersType BordersType

The new border type of the Dialog.

Remarks

For more information, consider visiting the documentation available here.

UpdateLeftOption(string?)

Updates the text of the second option.

public void UpdateLeftOption(string? text)

Parameters

text string

The new text of the second option.

Remarks

For more information, consider visiting the documentation available here.

UpdateLines(List<string>)

Updates the text of the Dialog.

public void UpdateLines(List<string> lines)

Parameters

lines List<string>

The new text of the Dialog.

Remarks

For more information, consider visiting the documentation available here.

UpdatePlacement(Placement)

Updates the placement of the Dialog.

public void UpdatePlacement(Placement placement)

Parameters

placement Placement

The new placement of the Dialog.

Remarks

For more information, consider visiting the documentation available here.

UpdateRightOption(string?)

Updates the text of the first option.

public void UpdateRightOption(string? text)

Parameters

text string

The new text of the first option.

Remarks

For more information, consider visiting the documentation available here.

UpdateTextAlignment(TextAlignment)

Updates the alignment of the Dialog.

public void UpdateTextAlignment(TextAlignment align)

Parameters

align TextAlignment

The new alignment of the Dialog.

Remarks

For more information, consider visiting the documentation available here.