Added option to immediately execute a task
This commit is contained in:
parent
312672a05c
commit
133b3146b5
@ -61,6 +61,12 @@ public static class Tranga_Cli
|
||||
Console.ReadKey();
|
||||
menu = 0;
|
||||
break;
|
||||
case 4:
|
||||
ExecuteTask(taskManager);
|
||||
Console.WriteLine("Press any key.");
|
||||
Console.ReadKey();
|
||||
menu = 0;
|
||||
break;
|
||||
default:
|
||||
selection = Menu(folderPath);
|
||||
switch (selection)
|
||||
@ -74,6 +80,9 @@ public static class Tranga_Cli
|
||||
case ConsoleKey.D:
|
||||
menu = 3;
|
||||
break;
|
||||
case ConsoleKey.E:
|
||||
menu = 4;
|
||||
break;
|
||||
default:
|
||||
menu = 0;
|
||||
break;
|
||||
@ -92,6 +101,7 @@ public static class Tranga_Cli
|
||||
Console.WriteLine("L: List tasks");
|
||||
Console.WriteLine("C: Create Task");
|
||||
Console.WriteLine("D: Delete Task");
|
||||
Console.WriteLine("E: Execute Task now");
|
||||
Console.WriteLine("Q: Exit with saving");
|
||||
ConsoleKey selection = Console.ReadKey().Key;
|
||||
Console.WriteLine();
|
||||
|
@ -34,6 +34,15 @@ public class TaskManager
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteTaskNow(TrangaTask task)
|
||||
{
|
||||
Task t = new Task(() =>
|
||||
{
|
||||
TaskExecutor.Execute(this.connectors, task, this._chapterCollection);
|
||||
});
|
||||
t.Start();
|
||||
}
|
||||
|
||||
public void AddTask(TrangaTask.Task task, string connectorName, Publication? publication, TimeSpan reoccurrence,
|
||||
string language = "")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user