Generated by DocFX

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 Source

BackgroundColor

Gets or sets the color of the background.

Declaration
ConsoleColor BackgroundColor { get; set; }
Property Value
Type Description
System.ConsoleColor

The color of the background.

| Improve this Doc View Source

CursorLeft

Gets or sets the cursor left position.

Declaration
int CursorLeft { get; set; }
Property Value
Type Description
System.Int32

The cursor left position.

| Improve this Doc View Source

CursorTop

Gets or sets the cursor top position.

Declaration
int CursorTop { get; set; }
Property Value
Type Description
System.Int32

The cursor top position.

| Improve this Doc View Source

CursorVisible

Sets a value indicating whether [cursor visible].

Declaration
bool CursorVisible { set; }
Property Value
Type Description
System.Boolean

true if [cursor visible]; otherwise, false.

| Improve this Doc View Source

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.

| Improve this Doc View Source

KeyAvailiable

Gets a value indicating whether [key availiable].

Declaration
bool KeyAvailiable { get; }
Property Value
Type Description
System.Boolean

true if [key availiable]; otherwise, false.

| Improve this Doc View Source

WindowHeight

Gets the height of the window.

Declaration
int WindowHeight { get; }
Property Value
Type Description
System.Int32

The height of the window.

| Improve this Doc View Source

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 Source

ClearCurrentLine(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.

| Improve this Doc View Source

MoveCursorDown(Int32)

Moves the cursor down.

Declaration
void MoveCursorDown(int lines)
Parameters
Type Name Description
System.Int32 lines

The lines.

| Improve this Doc View Source

MoveCursorUp(Int32)

Moves the cursor up.

Declaration
void MoveCursorUp(int lines)
Parameters
Type Name Description
System.Int32 lines

The lines.

| Improve this Doc View Source

ReadKey()

Reads the next key press

Declaration
ConsoleKeyInfo ReadKey()
Returns
Type Description
System.ConsoleKeyInfo

ConsoleKeyInfo

| Improve this Doc View Source

RestoreAsync()

Restores the terminal screen state

Declaration
Task RestoreAsync()
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

RestoreCursorPosition(Action)

Restores the cursor position.

Declaration
void RestoreCursorPosition(Action onRestore = null)
Parameters
Type Name Description
System.Action onRestore

The on restore.

| Improve this Doc View Source

SaveAsync()

Saves the terminal screen state

Declaration
Task SaveAsync()
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

SaveCursorPosition()

Saves the cursor position.

Declaration
void SaveCursorPosition()
| Improve this Doc View Source

Write(String)

Writes the specified text.

Declaration
void Write(string text = null)
Parameters
Type Name Description
System.String text

The text.

| Improve this Doc View Source

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.