AddFinishedTask() public method

Add an existing task to this list.
public AddFinishedTask ( Task task ) : void
task Task /// A to add. ///
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Transfer all the tasks to another tasklist, used for merging
        /// </summary>
        /// <param name="tasklist">
        /// The other <see cref="TaskList"/> tasklist to send the tasks to
        /// </param>
        public void TransferTasksTo(TaskList tasklist)
        {
            List<Task> to_transfer = new List<Task> ();

            foreach (Task task in Tasks) {
                if (!task.WasDeleted) {
                    Logger.Debug ("adding task " + task.Description ());
                    to_transfer.Add (task);
                }
            }

            foreach (Task task in to_transfer) {
                tasklist.AddFinishedTask (task);
                task.RemoveTag (Tag);
                Tasks.Remove (task);
            }

            Delete ();
            tasklist.LockEnd ();
        }