Exemple #1
0
 /// <summary>
 ///     Delete a task
 /// </summary>
 /// <param name="task">the task to delete</param>
 public void DeleteTask(Task task)
 {
     task.Disable();
     task.TaskExecuted -= OnTaskExecuted;
     if (Tasks != null && Tasks.ContainsKey(task.Name))
     {
         Tasks.Remove(task.Name);
     }
     OnTaskListAltered();// list changed, invoke event
     SaveConfig();
 }
Exemple #2
0
        /// <summary>
        ///     Delete a task
        /// </summary>
        /// <param name="task">the task to delete</param>
        public void DeleteTask(Task task)
        {
            if (task == null)
            {
                return;
            }

            task.Disable();
            task.TaskExecuted -= OnTaskExecuted;

            if (Tasks != null && Tasks.ContainsKey(task.Name))
            {
                Tasks.Remove(task.Name);
            }

            task.Dispose();      // make sure it's removed
            OnTaskListAltered(); // list changed, invoke event
            SaveConfig();
        }
Exemple #3
0
        /// <summary>
        ///     Delete a task
        /// </summary>
        /// <param name="task">the task to delete</param>
        public void DeleteTask(Task task)
        {
	        if (task == null) return;

            task.Disable();
            task.TaskExecuted -= OnTaskExecuted;

            if (Tasks != null && Tasks.ContainsKey(task.Name)) Tasks.Remove(task.Name);

            task.Dispose(); // make sure it's removed
			OnTaskListAltered();// list changed, invoke event
            SaveConfig();
        }