Exemplo n.º 1
0
 private void ATaskFinished(ManagedTask task)
 {
     numOfTasksRemaining--;
     if (numOfTasksRemaining == 0)
     {
         FinishedAllTasks();
     }
 }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 public void AddTask(ManagedTask task)
 {
     Tasks.Add(task);
 }