Class BaseInteractiveTui<TPrimary, TSecondary>
A base class for your interactive user interface for terminal apps
Implements
Namespace: Terminaux.Inputs.Interactive
Assembly: Terminaux.dll
Syntax
public class BaseInteractiveTui<TPrimary, TSecondary> : IInteractiveTui<TPrimary, TSecondary>
Type Parameters
Name | Description |
---|---|
TPrimary | |
TSecondary |
Properties
| Edit this page View SourceAcceptsEmptyData
Whether empty data is accepted
Declaration
public virtual bool AcceptsEmptyData { get; }
Property Value
Type | Description |
---|---|
bool |
Bindings
All key bindings for your interactive user interface
Declaration
public List<InteractiveTuiBinding<TPrimary, TSecondary>> Bindings { get; }
Property Value
Type | Description |
---|---|
List<InteractiveTuiBinding<TPrimary, TSecondary>> |
CurrentInfoLine
Current info line index
Declaration
public int CurrentInfoLine { get; }
Property Value
Type | Description |
---|---|
int |
CurrentPane
Current pane
Declaration
public int CurrentPane { get; }
Property Value
Type | Description |
---|---|
int |
FirstPaneCurrentSelection
Current selection for the first pane
Declaration
public int FirstPaneCurrentSelection { get; }
Property Value
Type | Description |
---|---|
int |
PrimaryDataSource
An array, a dictionary, a list, or an enumerable that holds data (pane one)
Declaration
public virtual IEnumerable<TPrimary> PrimaryDataSource { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TPrimary> |
RefreshInterval
How many milliseconds to wait before refreshing? Only applies to single-pane interactive TUI instances. 0 to disable.
Declaration
public virtual int RefreshInterval { get; }
Property Value
Type | Description |
---|---|
int |
SecondPaneCurrentSelection
Current selection for the second pane
Declaration
public int SecondPaneCurrentSelection { get; }
Property Value
Type | Description |
---|---|
int |
SecondPaneInteractable
Whether the user can switch to the second path
Declaration
public virtual bool SecondPaneInteractable { get; }
Property Value
Type | Description |
---|---|
bool |
SecondaryDataSource
An array, a dictionary, a list, or an enumerable that holds data (pane two)
Declaration
public virtual IEnumerable<TSecondary> SecondaryDataSource { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TSecondary> |
Settings
Interactive TUI settings
Declaration
public InteractiveTuiSettings Settings { get; set; }
Property Value
Type | Description |
---|---|
InteractiveTuiSettings |
Status
Current status
Declaration
public string Status { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceGetEntryFromItem(TPrimary)
Gets an entry string from a specified item for listing
Declaration
public virtual string GetEntryFromItem(TPrimary item)
Parameters
Type | Name | Description |
---|---|---|
TPrimary | item | Target item |
Returns
Type | Description |
---|---|
string |
GetEntryFromItemSecondary(TSecondary)
Gets an entry string from a specified item for listing
Declaration
public virtual string GetEntryFromItemSecondary(TSecondary item)
Parameters
Type | Name | Description |
---|---|---|
TSecondary | item | Target item |
Returns
Type | Description |
---|---|
string |
GetInfoFromItem(TPrimary)
Gets the info from the item
Declaration
public virtual string GetInfoFromItem(TPrimary item)
Parameters
Type | Name | Description |
---|---|---|
TPrimary | item | Target item |
Returns
Type | Description |
---|---|
string | The rendered info so that InteractiveTuiTools can handle its rendering |
GetInfoFromItemSecondary(TSecondary)
Gets the info from the item
Declaration
public virtual string GetInfoFromItemSecondary(TSecondary item)
Parameters
Type | Name | Description |
---|---|---|
TSecondary | item | Target item |
Returns
Type | Description |
---|---|
string | The rendered info so that InteractiveTuiTools can handle its rendering |
GetStatusFromItem(TPrimary)
Gets the status from the item
Declaration
public virtual string GetStatusFromItem(TPrimary item)
Parameters
Type | Name | Description |
---|---|---|
TPrimary | item | Target item |
Returns
Type | Description |
---|---|
string |
GetStatusFromItemSecondary(TSecondary)
Gets the status from the item
Declaration
public virtual string GetStatusFromItemSecondary(TSecondary item)
Parameters
Type | Name | Description |
---|---|---|
TSecondary | item | Target item |
Returns
Type | Description |
---|---|
string |
HandleExit()
Handles exiting the interactive TUI
Declaration
public virtual void HandleExit()