BadScript 2
Loading...
Searching...
No Matches
BadScript2.ConsoleAbstraction.BadConsole Class Reference

Wrapper class for the console abstraction. More...

Static Public Member Functions

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.
 

Properties

static ConsoleColor ForegroundColor [get, set]
 The Foreground Color.
 
static ConsoleColor BackgroundColor [get, set]
 The Background Color.
 

Static Private Member Functions

static BadConsole ()
 Static Constructor.
 

Static Private Attributes

static IBadConsole s_Console
 The Console Implementation that is used.
 

Detailed Description

Wrapper class for the console abstraction.

Definition at line 11 of file BadConsole.cs.

Constructor & Destructor Documentation

◆ 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.
Definition BadConsole.cs:16
Implements a wrapper for the default system console.

Member Function Documentation

◆ Clear()

static void BadScript2.ConsoleAbstraction.BadConsole.Clear ( )
static

Clears the console.

Definition at line 102 of file BadConsole.cs.

103 {
105 }

◆ GetConsole()

static IBadConsole BadScript2.ConsoleAbstraction.BadConsole.GetConsole ( )
static

Returns the Current Console Implementation.

Returns
Console Implementation

Definition at line 49 of file BadConsole.cs.

50 {
51 return s_Console;
52 }

◆ 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 {
87 return s_Console.ReadLine();
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 {
96 return s_Console.ReadLineAsync();
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
consoleThe new Console Implementation that will be used.

Definition at line 58 of file BadConsole.cs.

59 {
60 s_Console = console;
61 }

◆ Write()

static void BadScript2.ConsoleAbstraction.BadConsole.Write ( string  str)
static

Writes a string to the console.

Parameters
strThe String to be written

Definition at line 67 of file BadConsole.cs.

68 {
69 s_Console.Write(str);
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
strThe 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.

Member Data Documentation

◆ s_Console

IBadConsole BadScript2.ConsoleAbstraction.BadConsole.s_Console
staticprivate

The Console Implementation that is used.

Definition at line 16 of file BadConsole.cs.

Property Documentation

◆ 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: