C# Класс StyleConsole, trivial

The command line interface.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Backspace ( int count = 1, bool doNotRemoveOutput = false ) : void

Enters a backspace to console to remove the last charactor.

BackspaceToBeginning ( ) : void

Enters backspaces to console to remove the charactors to the beginning of the line.

Clear ( RelativeAreas area ) : void

Removes the specific area.

IsBlockOutputOnly ( IConsoleTextCreator instance ) : bool

Tests if the output of the instance always contain a line terminator.

MoveCursorBy ( int x, int y ) : void

Moves cursor by a specific relative position.

MoveCursorTo ( int x, int y ) : void

Moves cursor at a specific position in buffer.

ReadKey ( bool intercept = false ) : ConsoleKeyInfo,

Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window.

ReadLine ( ) : string

Reads the next line of characters from the standard input stream.

ReadPassword ( ) : SecureString,

Obtains the password pressed by the user.

ReadPassword ( ConsoleColor? foreground, char? replaceChar, bool inline = false ) : SecureString,

Obtains the password pressed by the user.

ReadPassword ( char replaceChar, bool inline = false ) : SecureString,

Obtains the password pressed by the user.

Приватные методы

Метод Описание
BackspaceInternal ( int count = 1, int keepLevel ) : void

Enters a backspace to console to remove the last charactor.

ClearInCmd ( RelativeAreas area ) : void
ReadLine ( ConsoleColor? foreground, SecureString, str, char? replaceChar, bool inline = false ) : void
TestMode ( ) : void

Описание методов

Backspace() публичный Метод

Enters a backspace to console to remove the last charactor.
public Backspace ( int count = 1, bool doNotRemoveOutput = false ) : void
count int The count of the charactor to remove from end.
doNotRemoveOutput bool true if just only move cursor back and keep output; otherwise, false.
Результат void

BackspaceToBeginning() публичный Метод

Enters backspaces to console to remove the charactors to the beginning of the line.
public BackspaceToBeginning ( ) : void
Результат void

Clear() публичный Метод

Removes the specific area.
public Clear ( RelativeAreas area ) : void
area RelativeAreas The area to remove.
Результат void

IsBlockOutputOnly() публичный статический Метод

Tests if the output of the instance always contain a line terminator.
public static IsBlockOutputOnly ( IConsoleTextCreator instance ) : bool
instance IConsoleTextCreator The instance of the console handler wrapper.
Результат bool

MoveCursorBy() публичный Метод

Moves cursor by a specific relative position.
public MoveCursorBy ( int x, int y ) : void
x int The horizontal translation size.
y int The vertical translation size.
Результат void

MoveCursorTo() публичный Метод

Moves cursor at a specific position in buffer.
public MoveCursorTo ( int x, int y ) : void
x int Column (zero-based), the left from the edge of buffer.
y int Row (zero-based) the top from the edge of buffer; or -1 if do not move.
Результат void

ReadKey() публичный Метод

Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window.
An I/O error occurred. The input stream is redirected from the one other than the console.
public ReadKey ( bool intercept = false ) : ConsoleKeyInfo,
intercept bool Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false.
Результат ConsoleKeyInfo,

ReadLine() публичный Метод

Reads the next line of characters from the standard input stream.
An I/O error occurred. There is insufficient memory to allocate a buffer for the returned string. The number of characters in the next line of characters is greater than max value of 32-bit integer.
public ReadLine ( ) : string
Результат string

ReadPassword() публичный Метод

Obtains the password pressed by the user.
public ReadPassword ( ) : SecureString,
Результат SecureString,

ReadPassword() публичный Метод

Obtains the password pressed by the user.
public ReadPassword ( ConsoleColor? foreground, char? replaceChar, bool inline = false ) : SecureString,
foreground ConsoleColor? The replace charactor color.
replaceChar char? The optional charactor to output to replace the original one, such as *.
inline bool true if do not follow the line terminator after typing the password; otherwise, false.
Результат SecureString,

ReadPassword() публичный Метод

Obtains the password pressed by the user.
public ReadPassword ( char replaceChar, bool inline = false ) : SecureString,
replaceChar char The optional charactor to output to replace the original one, such as *.
inline bool true if do not follow the line terminator after typing the password; otherwise, false.
Результат SecureString,