private void ATaskFinished(ManagedTask task) { numOfTasksRemaining--; if (numOfTasksRemaining == 0) { FinishedAllTasks(); } }
private void btnTestTask_Click(object sender, RoutedEventArgs e) { int index = dGridTasks.SelectedIndex; ManagedTask task = Model.Tasks[index]; bool started = task.Execute(); if (!started) { MessageBox.Show("Could not execute the task: " + task, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void btnAddTask_Click(object sender, RoutedEventArgs e) { FileFolderDialog taskTypeWin = new FileFolderDialog(); string taskPath = taskTypeWin.ShowDialog(); // Process save file dialog box results if (taskPath != "") { ManagedTask newTask = new ManagedTask(); newTask.TaskPath = taskPath; newTask.Name = Path.GetFileName(taskPath); Model.AddTask(newTask); } }
public void AddTask(ManagedTask task) { Tasks.Add(task); }