Project DescriptionThis library provides a simplified but still very powerful wrapper around the .NET Task Parallel Library, allowing simple task creation and monitoring.
This library provides easy access to the Task Parallel Library (TPL) framework by simplifying background task creation down to a single line. This library uses itself to manage and schedule tasks.
See below for examples.
// Create a simple task
TaskManager.Queue(new BackgroundTask(SomeTask));
// You can name a task
TaskManager.Queue(new BackgroundTask(SomeTask, "My Task"));
// You can tag a task
taskManager.Queue(new BackgroundTask(SomeTask, "My Task", tag: "Class1"));
// You can have your task scheduled to run on the UI thread
TaskManager.Queue(new BackgroundTask(SomeTask, "My Task", true));
// You can have your task execute a callback when it finishes (allows chaining)
TaskManager.Queue(new BackgroundTask(SomeTask, "My Task", false, MyCallback));
// You can have your callback run on the UI thread
TaskManager.Queue(new BackgroundTask(SomeTask, "My Task", false, MyCallback, true));
// You can delay a task from starting immediately
TaskManager.Queue(new BackgroundTask(SomeTask, "My Task", delay: 1000));
// you can chain tasks with a parent child relationship
var parent = TaskManager.Queue(new BackgroundTask(SomeTask, "My Parent Task"));
TaskManager.QueueAfter(parent, new BackgroundTask(SomeTask, "My Child Task"));
You can run as many task managers as you want (though one should be sufficient). I have included a test UI (with view models) that allows simple visualization of the tasks being managed.
