tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
IConsole.cs
Go to the documentation of this file.
1using System.Threading;
2using System.Threading.Tasks;
3
5{
9 interface IConsole
10 {
14 string? Title { get; }
15
19 bool Available { get; }
20
24 CancellationToken CancelKeyPress { get; }
25
33 Task WriteAsync(string? text, bool newLine, CancellationToken cancellationToken);
34
40 Task PressAnyKeyAsync(CancellationToken cancellationToken);
41
48 Task<string> ReadLineAsync(bool usePasswordChar, CancellationToken cancellationToken);
49
54 void SetTitle(string newTitle);
55 }
56}
Abstraction for global::System.Console.
Definition IConsole.cs:10
Task WriteAsync(string? text, bool newLine, CancellationToken cancellationToken)
Write some text to the IConsole.
string? Title
Gets or sets the IConsole window's title. Can return null if getting the console title is not support...
Definition IConsole.cs:14
CancellationToken CancelKeyPress
Gets a CancellationToken that triggers if Crtl+C or an equivalent is pressed.
Definition IConsole.cs:24
bool Available
If the IConsole is visible to the user.
Definition IConsole.cs:19
void SetTitle(string newTitle)
Sets a newTitle console window.
Task< string > ReadLineAsync(bool usePasswordChar, CancellationToken cancellationToken)
Read a line from the IConsole.
Task PressAnyKeyAsync(CancellationToken cancellationToken)
Wait for a key press on the IConsole.