BadScript 2
Loading...
Searching...
No Matches
BadSystemConsole.cs
Go to the documentation of this file.
1using System;
2using System.Threading.Tasks;
3
8
13{
15 public void Write(string str)
16 {
17 Console.Write(str);
18 }
19
21 public void WriteLine(string str)
22 {
23 Console.WriteLine(str);
24 }
25
27 public string ReadLine()
28 {
29 return Console.ReadLine() ?? string.Empty;
30 }
31
33 public Task<string> ReadLineAsync()
34 {
35 return Task.Run(Console.ReadLine);
36 }
37
39 public void Clear()
40 {
41 Console.Clear();
42 }
43
45 public ConsoleColor ForegroundColor
46 {
47 get => Console.ForegroundColor;
48 set => Console.ForegroundColor = value;
49 }
50
52 public ConsoleColor BackgroundColor
53 {
54 get => Console.BackgroundColor;
55 set => Console.BackgroundColor = value;
56 }
57}
Implements a wrapper for the default system console.
void WriteLine(string str)
Writes a string to the console and appends a newline.
void Write(string str)
Writes a string to the console.
Task< string > ReadLineAsync()
Reads a line from the console asynchronously.The line that was read
string ReadLine()
Reads a line from the console.The line that was read
Interface that abstracts the console.
Contains Implementation of the Console Abstractions.