コード例 #1
0
 private void ATaskFinished(ManagedTask task)
 {
     numOfTasksRemaining--;
     if (numOfTasksRemaining == 0)
     {
         FinishedAllTasks();
     }
 }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #4
0
 public void AddTask(ManagedTask task)
 {
     Tasks.Add(task);
 }