2
0

Added Menu options:

List Running Tasks
Search Task (by name)
This commit is contained in:
glax 2023-05-20 00:30:24 +02:00
parent 84542640dc
commit 3c1865de31

View File

@ -73,6 +73,24 @@ public static class Tranga_Cli
Console.ReadKey(); Console.ReadKey();
menu = 0; menu = 0;
break; break;
case 5:
Console.WriteLine("Search-Query (Name):");
string? query = Console.ReadLine();
while (query is null || query.Length < 1)
query = Console.ReadLine();
PrintTasks(taskManager.GetAllTasks().Where(task =>
((Publication)task.publication!).sortName.ToLower()
.Contains(query, StringComparison.OrdinalIgnoreCase)).ToArray());
Console.WriteLine("Press any key.");
Console.ReadKey();
menu = 0;
break;
case 6:
PrintTasks(taskManager.GetAllTasks().Where(task => task.isBeingExecuted).ToArray());
Console.WriteLine("Press any key.");
Console.ReadKey();
menu = 0;
break;
default: default:
selection = Menu(taskManager, folderPath); selection = Menu(taskManager, folderPath);
switch (selection) switch (selection)
@ -92,6 +110,12 @@ public static class Tranga_Cli
case ConsoleKey.U: case ConsoleKey.U:
menu = 0; menu = 0;
break; break;
case ConsoleKey.S:
menu = 5;
break;
case ConsoleKey.R:
menu = 6;
break;
default: default:
menu = 0; menu = 0;
break; break;
@ -120,6 +144,8 @@ public static class Tranga_Cli
Console.WriteLine("C: Create Task"); Console.WriteLine("C: Create Task");
Console.WriteLine("D: Delete Task"); Console.WriteLine("D: Delete Task");
Console.WriteLine("E: Execute Task now"); Console.WriteLine("E: Execute Task now");
Console.WriteLine("S: Search Task");
Console.WriteLine("R: Running Tasks");
Console.WriteLine("Q: Exit"); Console.WriteLine("Q: Exit");
ConsoleKey selection = Console.ReadKey().Key; ConsoleKey selection = Console.ReadKey().Key;
Console.WriteLine(); Console.WriteLine();