Class TermReaderTools
Terminal reader tools
Inheritance
Namespace: Terminaux.Reader
Assembly: Terminaux.dll
Syntax
public static class TermReaderTools
Properties
| Edit this page View SourceBusy
Specifies whether the terminal reader is busy waiting for input or not
Declaration
public static bool Busy { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceGetMaximumInputLength()
Gets the maximum input length for the current reader session
Declaration
public static int GetMaximumInputLength()
Returns
Type | Description |
---|---|
int | The maximum input length of an input. -1 if there is no reader. |
InsertNewText(string, bool, bool)
Inserts new text to the current reader
Declaration
public static void InsertNewText(string newText, bool append = false, bool step = true)
Parameters
Type | Name | Description |
---|---|---|
string | newText | New text to insert or append |
bool | append | Whether to append the new text to the end of the input or to insert text to the current position |
bool | step | Whether to move the cursor forward after inserting or not |
Interrupt()
Interrupts the reading process
Declaration
public static void Interrupt()
Refresh()
Refreshes the reader prompt
Declaration
public static void Refresh()
RemoveText(int, bool)
Removes text from the current position
Declaration
public static void RemoveText(int length, bool step = false)
Parameters
Type | Name | Description |
---|---|---|
int | length | Length of characters to remove |
bool | step | Whether to step backwards after removing characters |
RemoveText(int, int, bool)
Removes text from the current position
Declaration
public static void RemoveText(int startIndex, int length, bool step = false)
Parameters
Type | Name | Description |
---|---|---|
int | startIndex | Zero-based index of where to start removing |
int | length | Length of characters to remove |
bool | step | Whether to step backwards after removing characters |
WaitForInput()
Waits indefinitely for an input. Returns immediately if not busy.
Declaration
public static void WaitForInput()
WipeAll()
Wipes the entire input
Declaration
public static void WipeAll()