Interface ITerminalConsole
An abstraction of a console for terminal framework.
public interface ITerminalConsole
Remarks
ITerminalConsole allows application to define a standard or a custom console environment.
Properties
BackgroundColor
The background color of the ITerminalConsole.
ConsoleColor BackgroundColor { get; set; }
Property Value
ForegroundColor
The foreground color of the ITerminalConsole.
ConsoleColor ForegroundColor { get; set; }
Property Value
In
Gets the standard console input stream.
TextReader In { get; }
Property Value
Out
Gets the standard console output stream.
TextWriter Out { get; }
Property Value
Methods
ClearAsync()
Clears the ITerminalConsole buffer and the corresponding display information.
Task ClearAsync()
Returns
Ignore(string?)
Return true
if the specified string value is ignored by the ITerminalConsole, otherwise false
.
bool Ignore(string? value)
Parameters
value
stringThe value to check.
Returns
ReadAnswerAsync(string, params string[]?)
Prints the question to the ITerminalConsole standard output stream and waits for an answer asynchronously.
Task<string> ReadAnswerAsync(string question, params string[]? answers)
Parameters
Returns
ReadLineAsync()
Reads the next line of characters from the ITerminalConsole input stream asynchronously.
Task<string?> ReadLineAsync()
Returns
- Task<string>
The next line of characters from the input stream, or
null
if no more lines are available.
WriteAsync(string, params object[])
Writes the specified string value to the ITerminalConsole standard output stream.
Task WriteAsync(string value, params object[] args)
Parameters
Returns
WriteColorAsync(ConsoleColor, string, params object[])
Writes the specified string value in the foreground color to the ITerminalConsole standard output stream.
Task WriteColorAsync(ConsoleColor foregroundColor, string value, params object[] args)
Parameters
foregroundColor
ConsoleColorThe foreground text color.
value
stringThe text to write.
args
object[]The format arguments.
Returns
WriteLineAsync()
Writes the current newline terminator to the ITerminalConsole input stream asynchronously.
Task WriteLineAsync()
Returns
WriteLineAsync(string, params object[])
Writes the specified string value followed by the current newline terminator to the ITerminalConsole standard output stream.
Task WriteLineAsync(string value, params object[] args)
Parameters
Returns
WriteLineColorAsync(ConsoleColor, string, params object[])
Writes the specified string value in the foreground color followed by the current newline terminator to the ITerminalConsole standard output stream.
Task WriteLineColorAsync(ConsoleColor foregroundColor, string value, params object[] args)
Parameters
foregroundColor
ConsoleColorThe foreground text color.
value
stringThe text to write.
args
object[]The format arguments.