Class TextualUI
Base textual UI class for your interactive applications
Inheritance
Namespace
Syntax
public abstract class TextualUI
Properties
Fallback
Fallback keybinding in case defined keybinding doesn't exist.
Property Value
Declaration
public Action<TextualUI, ConsoleKeyInfo, PointerEventContext?>? Fallback { get; set; }
Guid
Unique ID for this textual UI
Property Value
Declaration
public Guid Guid { get; }
HelpPages
A list of help pages
Property Value
Declaration
public virtual InteractiveTuiHelpPage[] HelpPages { get; }
Keybindings
List of available keybindings
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.
Property Value
Declaration
public virtual List<(Keybinding binding, Action<TextualUI, ConsoleKeyInfo, PointerEventContext?> action)> Keybindings { get; }
Name
Name of the interactive textual UI
Property Value
Declaration
public string Name { get; set; }
RefreshDelay
Refresh delay. If set to zero or less than zero, this means that this UI doesn't refresh itself.
Property Value
Declaration
public int RefreshDelay { get; set; }
Renderables
List of renderable contianers that are going to be laid out on top of what Render() prints to the console.
State
State of this textual UI
Methods
Render()
Renders this interactive textual UI
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.
Returns
A string generated by this function for the RunTui(TextualUI?) function to render to the console
Declaration
public abstract string Render()
RequireRefresh()
Tells the textual UI that the refresh is required
Declaration
public void RequireRefresh()
ResetKeybindings()
Resets the keybindings
Declaration
public void ResetKeybindings()