Interface IConsole
Defines the method that a console implementation is required to provide
Namespace: Dotnet.Shell.Logic.Console
Assembly: dotnet-shell-lib.dll
Syntax
public interface IConsole
Properties
| Improve this Doc View SourceBackgroundColor
Gets or sets the color of the background.
Declaration
ConsoleColor BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.ConsoleColor | The color of the background. |
CursorLeft
Gets or sets the cursor left position.
Declaration
int CursorLeft { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The cursor left position. |
CursorTop
Gets or sets the cursor top position.
Declaration
int CursorTop { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The cursor top position. |
CursorVisible
Sets a value indicating whether [cursor visible].
Declaration
bool CursorVisible { set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
ForegroundColor
Gets or sets the color of the foreground.
Declaration
ConsoleColor ForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.ConsoleColor | The color of the foreground. |
KeyAvailiable
Gets a value indicating whether [key availiable].
Declaration
bool KeyAvailiable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
WindowHeight
Gets the height of the window.
Declaration
int WindowHeight { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The height of the window. |
WindowWidth
Gets the width of the window.
Declaration
int WindowWidth { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The width of the window. |
Methods
| Improve this Doc View SourceClearCurrentLine(Int32)
Clears the current line from given position.
Declaration
void ClearCurrentLine(int pos = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pos | If set the current line will be cleared from this position, cursor will be moved here. |
MoveCursorDown(Int32)
Moves the cursor down.
Declaration
void MoveCursorDown(int lines)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | lines | The lines. |
MoveCursorUp(Int32)
Moves the cursor up.
Declaration
void MoveCursorUp(int lines)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | lines | The lines. |
ReadKey()
Reads the next key press
Declaration
ConsoleKeyInfo ReadKey()
Returns
| Type | Description |
|---|---|
| System.ConsoleKeyInfo | ConsoleKeyInfo |
RestoreAsync()
Restores the terminal screen state
Declaration
Task RestoreAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
RestoreCursorPosition(Action)
Restores the cursor position.
Declaration
void RestoreCursorPosition(Action onRestore = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action | onRestore | The on restore. |
SaveAsync()
Saves the terminal screen state
Declaration
Task SaveAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
SaveCursorPosition()
Saves the cursor position.
Declaration
void SaveCursorPosition()
Write(String)
Writes the specified text.
Declaration
void Write(string text = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text. |
WriteLine(String)
Writes the specified text with a newline at the end
Declaration
void WriteLine(string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message. |