Beispiel #1
0
        private static void RunManualTasks()
        {
            var tasks = TaskController.GetProcessTasks(BackgroundTaskStatus.Stopping);

            foreach (var task in tasks)
            {
                TaskManager.StopTask(task.TaskId);
            }

            tasks = TaskController.GetProcessTasks(BackgroundTaskStatus.Starting);

            foreach (var task in tasks)
            {
                var taskThread = new Thread(() => RunBackgroundTask(task))
                {
                    Priority = ThreadPriority.Highest
                };
                taskThread.Start();
                TaskManager.AddTaskThread(task.Id, taskThread);
            }
        }