mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-01-31 00:47:30 +01:00
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();
|
Console.ReadKey();
|
||||||
menu = 0;
|
menu = 0;
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
ExecuteTask(taskManager);
|
||||||
|
Console.WriteLine("Press any key.");
|
||||||
|
Console.ReadKey();
|
||||||
|
menu = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
selection = Menu(folderPath);
|
selection = Menu(folderPath);
|
||||||
switch (selection)
|
switch (selection)
|
||||||
@ -74,6 +80,9 @@ public static class Tranga_Cli
|
|||||||
case ConsoleKey.D:
|
case ConsoleKey.D:
|
||||||
menu = 3;
|
menu = 3;
|
||||||
break;
|
break;
|
||||||
|
case ConsoleKey.E:
|
||||||
|
menu = 4;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
menu = 0;
|
menu = 0;
|
||||||
break;
|
break;
|
||||||
@ -92,6 +101,7 @@ public static class Tranga_Cli
|
|||||||
Console.WriteLine("L: List tasks");
|
Console.WriteLine("L: List tasks");
|
||||||
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("Q: Exit with saving");
|
Console.WriteLine("Q: Exit with saving");
|
||||||
ConsoleKey selection = Console.ReadKey().Key;
|
ConsoleKey selection = Console.ReadKey().Key;
|
||||||
Console.WriteLine();
|
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,
|
public void AddTask(TrangaTask.Task task, string connectorName, Publication? publication, TimeSpan reoccurrence,
|
||||||
string language = "")
|
string language = "")
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user