Table of Contents

Class MultipleTuiScreenInteractive

Namespace
AshConsoleGraphics.Interactive
Assembly
AshConsoleGraphics.dll

Screen aimed at handling having multiple interactive screens at the same time, and only controlling one

public class MultipleTuiScreenInteractive : TuiScreen, IEnumerable<TuiElement>, IEnumerable
Inheritance
MultipleTuiScreenInteractive
Implements
Inherited Members

Constructors

MultipleTuiScreenInteractive(int, int, IEnumerable<TuiScreenInteractive>, Placement, int, int, CharFormat?, params TuiElement[])

Initializes a new instance of a MultipleTuiScreenInteractive screen. Note that it starts with no selected screen

public MultipleTuiScreenInteractive(int xs, int ys, IEnumerable<TuiScreenInteractive> ss, Placement p, int x, int y, CharFormat? f, params TuiElement[] e)

Parameters

xs int

The x size

ys int

The y size

ss IEnumerable<TuiScreenInteractive>

All the interactive screens

p Placement
x int
y int
f CharFormat

The default format

e TuiElement[]

Additional elements

MultipleTuiScreenInteractive(int, int, IEnumerable<TuiScreenInteractive>, CharFormat?, params TuiElement[])

Initializes a new instance of a MultipleTuiScreenInteractive screen. Note that it starts with no selected screen

public MultipleTuiScreenInteractive(int xs, int ys, IEnumerable<TuiScreenInteractive> ss, CharFormat? f, params TuiElement[] e)

Parameters

xs int

The x size

ys int

The y size

ss IEnumerable<TuiScreenInteractive>

All the interactive screens

f CharFormat

The default format

e TuiElement[]

Additional elements

Fields

OnFinishPlayCycle

Event called at the end of each play cycle

public EventHandler OnFinishPlayCycle

Field Value

EventHandler

WaitForKey

If the screen will wait for a key press before updating

public bool WaitForKey

Field Value

bool

Properties

KeyFunctions

The key actions

public Dictionary<(ConsoleKey, ConsoleModifiers), Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>> KeyFunctions { get; }

Property Value

Dictionary<(ConsoleKey, ConsoleModifiers), Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>>

Playing

If this screen is playing

public bool Playing { get; }

Property Value

bool

ScreenList

All the interactive screens

public ReactiveList<TuiScreenInteractive> ScreenList { get; }

Property Value

ReactiveList<TuiScreenInteractive>

SelectedScreen

The curently selected screen

public TuiScreenInteractive SelectedScreen { get; set; }

Property Value

TuiScreenInteractive

Methods

DeleteAllKeyEvents()

Clears all existent key events and returns itself

public MultipleTuiScreenInteractive DeleteAllKeyEvents()

Returns

MultipleTuiScreenInteractive

HandleKey(ConsoleKeyInfo)

Handle a key press

public bool HandleKey(ConsoleKeyInfo keyInfo)

Parameters

keyInfo ConsoleKeyInfo

Returns

bool

Play()

Plays the interactive screen. Handles all key presses

public void Play()

StopPlaying(MultipleTuiScreenInteractive, ConsoleKeyInfo)

Stop a screen playing

public static void StopPlaying(MultipleTuiScreenInteractive s, ConsoleKeyInfo ck)

Parameters

s MultipleTuiScreenInteractive
ck ConsoleKeyInfo

SubKeyEvent(ConsoleKey, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>)

Adds a new key event with no modifiers and returns itself

public MultipleTuiScreenInteractive SubKeyEvent(ConsoleKey k, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo> keyFunction)

Parameters

k ConsoleKey
keyFunction Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>

Returns

MultipleTuiScreenInteractive

SubKeyEvent(ConsoleKey, ConsoleModifiers, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>)

Adds a new key event and returns itself

public MultipleTuiScreenInteractive SubKeyEvent(ConsoleKey k, ConsoleModifiers m, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo> keyFunction)

Parameters

k ConsoleKey
m ConsoleModifiers
keyFunction Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>

Returns

MultipleTuiScreenInteractive