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
stringThe text of the left option. Null for no button.
rightOption
stringThe text of the right option. Null for no button.
align
TextAlignmentThe alignment of the Dialog.
placement
PlacementThe placement of the Dialog element.
bordersType
BordersTypeThe 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
BordersType
Gets the border type of the selector.
public BordersType BordersType { get; }
Property Value
Height
Gets the height of the Dialog.
public override int Height { get; }
Property Value
LeftOption
Gets the text of the left option.
public string? LeftOption { get; }
Property Value
Lines
Gets the rows of the Dialog.
public List<string> Lines { get; }
Property Value
Placement
Gets the position of the Dialog.
public override Placement Placement { get; }
Property Value
RightOption
Gets the text of the right option.
public string? RightOption { get; }
Property Value
TextAlignment
Gets the alignment of the Dialog.
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 Dialog.
public override int Width { get; }
Property Value
Methods
AddLine(string)
Adds a line to the Dialog.
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 Dialog.
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 Dialog.
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 Dialog.
public void RemoveLine(string line)
Parameters
line
stringThe 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
BordersTypeThe 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
stringThe 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
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
PlacementThe 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
stringThe 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
TextAlignmentThe new alignment of the Dialog.
Remarks
For more information, consider visiting the documentation available here.