-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathConsoleInputTheme.cs
More file actions
69 lines (67 loc) · 2.94 KB
/
ConsoleInputTheme.cs
File metadata and controls
69 lines (67 loc) · 2.94 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
namespace BytecodeApi.ConsoleUI;
/// <summary>
/// Represents a theme for the <see cref="ConsoleInput" /> class.
/// </summary>
public sealed class ConsoleInputTheme
{
/// <summary>
/// Specifies the style for questions.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.White" />, <see cref="ConsoleColor.DarkGray" />).</para>
/// </summary>
public ConsoleStyle QuestionStyle { get; set; }
/// <summary>
/// Specifies the style for options when <see cref="ConsoleInput.Select(string, string[])" /> is called.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.White" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle SelectOptionsStyle { get; set; }
/// <summary>
/// Specifies the text that is displayed before the user input prompt when <see cref="ConsoleInput.Select(string, string[])" /> is called.
/// <para>The default value is "Select:".</para>
/// </summary>
public string SelectOptionsPromptText { get; set; }
/// <summary>
/// Specifies the style for user input.
/// <para>The default value is <see langword="new" /> <see cref="ConsoleStyle" />(<see cref="ConsoleColor.White" />, <see cref="ConsoleColor.Black" />).</para>
/// </summary>
public ConsoleStyle UserInputStyle { get; set; }
/// <summary>
/// Specifies the question postfix for a confirmation.
/// <para>The default value is "[y/n]".</para>
/// </summary>
public string ConfirmationPostfix { get; set; }
/// <summary>
/// Specifies the question postfix for a confirmation, if the default answer is <see langword="true" />.
/// <para>The default value is "[Y/n]".</para>
/// </summary>
public string ConfirmationPostfixDefaultYes { get; set; }
/// <summary>
/// Specifies the question postfix for a confirmation, if the default answer is <see langword="false" />.
/// <para>The default value is "[y/N]".</para>
/// </summary>
public string ConfirmationPostfixDefaultNo { get; set; }
/// <summary>
/// Specifies the expected user input for a "yes" answer.
/// <para>The default value is "y".</para>
/// </summary>
public string ConfirmationAnswerYes { get; set; }
/// <summary>
/// Specifies the expected user input for a "no" answer.
/// <para>The default value is "n".</para>
/// </summary>
public string ConfirmationAnswerNo { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ConsoleInputTheme" /> class with default values.
/// </summary>
public ConsoleInputTheme()
{
QuestionStyle = new(ConsoleColor.White, ConsoleColor.DarkGray);
SelectOptionsStyle = new(ConsoleColor.White);
SelectOptionsPromptText = "Select:";
UserInputStyle = new(ConsoleColor.White);
ConfirmationPostfix = "[y/n]";
ConfirmationPostfixDefaultYes = "[Y/n]";
ConfirmationPostfixDefaultNo = "[y/N]";
ConfirmationAnswerYes = "y";
ConfirmationAnswerNo = "n";
}
}