Wrapper class for the console abstraction.
More...
|
static IBadConsole | GetConsole () |
| Returns the Current Console Implementation.
|
|
static void | SetConsole (IBadConsole console) |
| Sets the Current Console Implementation.
|
|
static void | Write (string str) |
| Writes a string to the console.
|
|
static void | WriteLine (string str) |
| Writes a string to the console and appends a newline.
|
|
static string | ReadLine () |
| Reads a line from the console.
|
|
static Task< string > | ReadLineAsync () |
| Reads a line from the console asynchronously.
|
|
static void | Clear () |
| Clears the console.
|
|
Wrapper class for the console abstraction.
Definition at line 11 of file BadConsole.cs.
◆ BadConsole()
static BadScript2.ConsoleAbstraction.BadConsole.BadConsole |
( |
| ) |
|
|
staticprivate |
Static Constructor.
Definition at line 21 of file BadConsole.cs.
22 {
24 }
static IBadConsole s_Console
The Console Implementation that is used.
Implements a wrapper for the default system console.
◆ Clear()
static void BadScript2.ConsoleAbstraction.BadConsole.Clear |
( |
| ) |
|
|
static |
Clears the console.
Definition at line 102 of file BadConsole.cs.
103 {
105 }
void Clear()
Clears the console.
◆ GetConsole()
static IBadConsole BadScript2.ConsoleAbstraction.BadConsole.GetConsole |
( |
| ) |
|
|
static |
Returns the Current Console Implementation.
- Returns
- Console Implementation
Definition at line 49 of file BadConsole.cs.
◆ ReadLine()
static string BadScript2.ConsoleAbstraction.BadConsole.ReadLine |
( |
| ) |
|
|
static |
Reads a line from the console.
- Returns
- The line that was read
Definition at line 85 of file BadConsole.cs.
86 {
88 }
string ReadLine()
Reads a line from the console.
◆ ReadLineAsync()
static Task< string > BadScript2.ConsoleAbstraction.BadConsole.ReadLineAsync |
( |
| ) |
|
|
static |
Reads a line from the console asynchronously.
- Returns
- The line that was read
Definition at line 94 of file BadConsole.cs.
95 {
97 }
Task< string > ReadLineAsync()
Reads a line from the console asynchronously.
◆ SetConsole()
static void BadScript2.ConsoleAbstraction.BadConsole.SetConsole |
( |
IBadConsole |
console | ) |
|
|
static |
Sets the Current Console Implementation.
- Parameters
-
console | The new Console Implementation that will be used. |
Definition at line 58 of file BadConsole.cs.
◆ Write()
static void BadScript2.ConsoleAbstraction.BadConsole.Write |
( |
string |
str | ) |
|
|
static |
Writes a string to the console.
- Parameters
-
str | The String to be written |
Definition at line 67 of file BadConsole.cs.
68 {
70 }
void Write(string str)
Writes a string to the console.
◆ WriteLine()
static void BadScript2.ConsoleAbstraction.BadConsole.WriteLine |
( |
string |
str | ) |
|
|
static |
Writes a string to the console and appends a newline.
- Parameters
-
str | The String to be written |
Definition at line 76 of file BadConsole.cs.
77 {
79 }
void WriteLine(string str)
Writes a string to the console and appends a newline.
◆ s_Console
IBadConsole BadScript2.ConsoleAbstraction.BadConsole.s_Console |
|
staticprivate |
The Console Implementation that is used.
Definition at line 16 of file BadConsole.cs.
◆ BackgroundColor
ConsoleColor BadScript2.ConsoleAbstraction.BadConsole.BackgroundColor |
|
staticgetset |
The Background Color.
Definition at line 39 of file BadConsole.cs.
40 {
42 set => s_Console.BackgroundColor = value;
43 }
ConsoleColor BackgroundColor
The Background Color.
◆ ForegroundColor
ConsoleColor BadScript2.ConsoleAbstraction.BadConsole.ForegroundColor |
|
staticgetset |
The Foreground Color.
Definition at line 30 of file BadConsole.cs.
31 {
33 set => s_Console.ForegroundColor = value;
34 }
ConsoleColor ForegroundColor
The Foreground Color.
The documentation for this class was generated from the following file:
- src/BadScript2.Common/BadScript2.ConsoleAbstraction/BadConsole.cs