Table of Contents

Class ScrollingMenu

Namespace
ConsoleAppVisuals.InteractiveElements
Assembly
ConsoleAppVisuals.dll

The ScrollingMenu is an interactive element that displays a question with multiple scrollable choices.

public class ScrollingMenu : InteractiveElement<int>
Inheritance
ScrollingMenu
Inherited Members

Remarks

For more information, consider visiting the documentation available here.

Constructors

ScrollingMenu(string, int, Placement, params string[])

The ScrollingMenu is an interactive element that displays a question with multiple scrollable choices.

public ScrollingMenu(string question, int defaultIndex = 0, Placement placement = Placement.TopCenter, params string[] choices)

Parameters

question string

The question to ask the user.

defaultIndex int

The index of the default choice(initially 0).

placement Placement

The placement of the menu on the console.

choices string[]

The different choices of the menu.

Remarks

For more information, consider visiting the documentation available here.

Properties

Choices

Gets the different choices of the menu.

public string[] Choices { get; }

Property Value

string[]

DefaultIndex

Gets the index of the default choice.

public int DefaultIndex { get; }

Property Value

int

Height

Gets the height of the menu.

public override int Height { get; }

Property Value

int

Placement

Gets the placement of the menu on the console.

public override Placement Placement { get; }

Property Value

Placement

Question

Gets the question to ask the user.

public string Question { get; }

Property Value

string

Selector

Gets the selector char of the menu.

public char Selector { get; }

Property Value

char

Width

Gets the width of the menu.

public override int Width { get; }

Property Value

int

Methods

RenderElementActions()

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

[Visual]
protected override void RenderElementActions()

UpdateChoices(params string[])

Updates the choices of the menu.

public void UpdateChoices(params string[] choices)

Parameters

choices string[]

The new choices of the menu.

Remarks

For more information, consider visiting the documentation available here.

UpdateDefaultIndex(int)

Updates the default index of the menu.

public void UpdateDefaultIndex(int defaultIndex)

Parameters

defaultIndex int

The new default index of the menu.

Remarks

For more information, consider visiting the documentation available here.

UpdatePlacement(Placement)

Updates the placement of the menu.

public void UpdatePlacement(Placement placement)

Parameters

placement Placement

The new placement of the menu.

Remarks

For more information, consider visiting the documentation available here.

UpdateQuestion(string)

Updates the question of the menu.

public void UpdateQuestion(string question)

Parameters

question string

The new question of the menu.

Remarks

For more information, consider visiting the documentation available here.

UpdateSelector(char)

Updates the selector of the menu.

public void UpdateSelector(char selector = '▶')

Parameters

selector char

The new selector of the menu.

Remarks

For more information, consider visiting the documentation available here.