Interface ICliTerminal
Terminal abstraction used by interactive rendering and test hosts.
public interface ICliTerminal
Properties
BackgroundColor
Current background colour.
CliColor BackgroundColor { get; set; }
Property Value
CursorLeft
Current cursor column.
int CursorLeft { get; }
Property Value
CursorTop
Current cursor row.
int CursorTop { get; }
Property Value
CursorVisible
Cursor visibility.
bool CursorVisible { get; set; }
Property Value
ForegroundColor
Current foreground colour.
CliColor ForegroundColor { get; set; }
Property Value
KeyAvailable
Whether a key press is available without blocking.
bool KeyAvailable { get; }
Property Value
Sink
Render sink used by this terminal.
ICliRenderSink Sink { get; }
Property Value
State
Captures the terminal state needed for later restoration.
ITerminalState State { get; }
Property Value
WindowHeight
Current terminal window height.
int WindowHeight { get; }
Property Value
WindowWidth
Current terminal window width.
int WindowWidth { get; }
Property Value
Methods
ClearLines(int, int, CliColor)
Clears a range of terminal rows using the supplied background colour.
void ClearLines(int fromRow, int count, CliColor bgColor)
Parameters
ReadKey(bool)
Reads a key from the terminal.
ConsoleKeyInfo ReadKey(bool intercept)
Parameters
interceptbool
Returns
RenderGrid(int, int, CliGrid)
Renders a grid at a terminal coordinate.
void RenderGrid(int x, int y, CliGrid grid)
Parameters
RestoreState(ITerminalState, int, int)
Restores a captured terminal state and clears the rendered region.
void RestoreState(ITerminalState terminalState, int startRow, int height)
Parameters
terminalStateITerminalStatestartRowintheightint
SetCursorPosition(int, int)
Moves the cursor.
void SetCursorPosition(int left, int top)