Compare commits
2 Commits
3fe43b6e63
...
c6bd342e87
Author | SHA1 | Date | |
---|---|---|---|
c6bd342e87 | |||
82e14c8b9e |
@ -46,15 +46,15 @@ public static class Setup
|
||||
switch (pressedKey)
|
||||
{
|
||||
case ConsoleKey.D1:
|
||||
Console.WriteLine("New LogLevel:");
|
||||
string[] levels = Enum.GetNames<LogLevel>();
|
||||
for(int i = 0; i < levels.Length; i++)
|
||||
Console.WriteLine($"{i}) {levels[i]}");
|
||||
int selected;
|
||||
while (!int.TryParse(Console.ReadKey().KeyChar.ToString(), out selected) || selected < 0 ||
|
||||
selected >= levels.Length)
|
||||
{//NYAA
|
||||
}
|
||||
do
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("New LogLevel:");
|
||||
for (int i = 0; i < levels.Length; i++)
|
||||
Console.WriteLine($"{i}) {levels[i]}");
|
||||
} while (!int.TryParse(Console.ReadKey().KeyChar.ToString(), out selected) || selected < 0 || selected >= levels.Length);
|
||||
Console.WriteLine();//NewLine after Input
|
||||
c.LogLevel = Enum.Parse<LogLevel>(levels[selected]);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user