-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathConsoleWriterTheme.cs
More file actions
105 lines (103 loc) · 4.14 KB
/
ConsoleWriterTheme.cs
File metadata and controls
105 lines (103 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
namespace BytecodeApi.ConsoleUI;
/// <summary>
/// Represents a theme for the <see cref="ConsoleWriter" /> class.
/// </summary>
public sealed class ConsoleWriterTheme
{
/// <summary>
/// Specifies the style for normal text.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.Gray" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle TextStyle { get; set; }
/// <summary>
/// Specifies the style for a preview message.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.Gray" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle PreviewStyle { get; set; }
/// <summary>
/// Specifies the style for a success message.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.Gray" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle SuccessStyle { get; set; }
/// <summary>
/// Specifies the style for a warning message.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.Yellow" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle WarningStyle { get; set; }
/// <summary>
/// Specifies the style for an error message.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.Red" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle ErrorStyle { get; set; }
/// <summary>
/// A <see cref="bool" /> value indicating whether to show a time stamp before each message.
/// <para>The default value is <see langword="true" />.</para>
/// </summary>
public bool ShowTimeStamp { get; set; }
/// <summary>
/// Specifies the string format for time stamps.
/// <para>The default value is "HH:mm:ss".</para>
/// </summary>
public string TimeStampFormat { get; set; }
/// <summary>
/// Specifies a text based icon that is used for preview messages.
/// <para>The default value is "...".</para>
/// </summary>
public string PreviewIcon { get; set; }
/// <summary>
/// Specifies a text based icon that is used for success messages.
/// <para>The default value is "[+]".</para>
/// </summary>
public string SuccessIcon { get; set; }
/// <summary>
/// Specifies a text based icon that is used for warning messages.
/// <para>The default value is "[!]".</para>
/// </summary>
public string WarningIcon { get; set; }
/// <summary>
/// Specifies a text based icon that is used for error messages.
/// <para>The default value is "[-]".</para>
/// </summary>
public string ErrorIcon { get; set; }
/// <summary>
/// Specifies the beginning character of a text based progress bar.
/// <para>The default value is "[".</para>
/// </summary>
public char ProgressBarBeginChar { get; set; }
/// <summary>
/// Specifies the closing character of a text based progress bar.
/// <para>The default value is "]".</para>
/// </summary>
public char ProgressBarEndChar { get; set; }
/// <summary>
/// Specifies the character of a text based progress bar that renders a full block.
/// <para>The default value is "█".</para>
/// </summary>
public char ProgressBarFullChar { get; set; }
/// <summary>
/// Specifies the character of a text based progress bar that renders an empty block.
/// <para>The default value is "░".</para>
/// </summary>
public char ProgressBarEmptyChar { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ConsoleWriterTheme" /> class with default values.
/// </summary>
public ConsoleWriterTheme()
{
TextStyle = new();
PreviewStyle = new();
SuccessStyle = new();
WarningStyle = new(ConsoleColor.Yellow);
ErrorStyle = new(ConsoleColor.Red);
ShowTimeStamp = true;
TimeStampFormat = "HH:mm:ss";
PreviewIcon = "...";
SuccessIcon = "[+]";
WarningIcon = "[!]";
ErrorIcon = "[-]";
ProgressBarBeginChar = '[';
ProgressBarEndChar = ']';
ProgressBarFullChar = '█';
ProgressBarEmptyChar = '░';
}
}