BadScript 2
Loading...
Searching...
No Matches
BadSystemConsole.cs
Go to the documentation of this file.
1using System;
2using System.Threading.Tasks;
3
8
13{
14#region IBadConsole Members
15
17 public void Write(string str)
18 {
19 Console.Write(str);
20 }
21
23 public void WriteLine(string str)
24 {
25 Console.WriteLine(str);
26 }
27
29 public string ReadLine()
30 {
31 return Console.ReadLine() ?? string.Empty;
32 }
33
35 public Task<string> ReadLineAsync()
36 {
37 return Task.Run(Console.ReadLine);
38 }
39
41 public void Clear()
42 {
43 Console.Clear();
44 }
45
47 public ConsoleColor ForegroundColor
48 {
49 get => Console.ForegroundColor;
50 set => Console.ForegroundColor = value;
51 }
52
54 public ConsoleColor BackgroundColor
55 {
56 get => Console.BackgroundColor;
57 set => Console.BackgroundColor = value;
58 }
59
60#endregion
61}
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.