Class TextualUI
Base textual UI class for your interactive applications
Namespace: Terminaux.Inputs.Interactive
Assembly: Terminaux.dll
Syntax
public abstract class TextualUI
Properties
| Edit this page View SourceFallback
Fallback keybinding in case defined keybinding doesn't exist. Can only be set once.
Declaration
public Action<TextualUI, ConsoleKeyInfo, PointerEventContext?>? Fallback { get; set; }
Property Value
Type | Description |
---|---|
Action<TextualUI, ConsoleKeyInfo, PointerEventContext> |
Guid
Unique ID for this textual UI
Declaration
public Guid Guid { get; }
Property Value
Type | Description |
---|---|
Guid |
Keybindings
List of available keybindings
Declaration
public virtual List<(Keybinding binding, Action<TextualUI, ConsoleKeyInfo, PointerEventContext?> action)> Keybindings { get; }
Property Value
Type | Description |
---|---|
List<(Keybinding binding, Action<TextualUI, ConsoleKeyInfo, PointerEventContext> action)> |
Remarks
You can edit this to add your custom keybindings, but it's preferrable to either place them in a constructor or in the overridden value, and to define the delegates in separate private functions inside the UI class.
Name
Name of the interactive textual UI
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
RefreshDelay
Refresh delay. If set to zero or less than zero, this means that this UI doesn't refresh itself.
Declaration
public int RefreshDelay { get; set; }
Property Value
Type | Description |
---|---|
int |
Renderables
List of renderable contianers that are going to be laid out on top of what Render() prints to the console.
Declaration
public virtual List<Container> Renderables { get; }
Property Value
Type | Description |
---|---|
List<Container> |
State
State of this textual UI
Declaration
public TextualUIState State { get; }
Property Value
Type | Description |
---|---|
TextualUIState |
Methods
| Edit this page View SourceRender()
Renders this interactive textual UI
Declaration
public abstract string Render()
Returns
Type | Description |
---|---|
string | A string generated by this function for the RunTui(TextualUI?) function to render to the console |
Remarks
Generated sequence, which will be used for rendering, has lower priority than Renderables, so any renderable container specified in that property will overwrite what's been rendered.
RequireRefresh()
Tells the textual UI that the refresh is required
Declaration
public void RequireRefresh()