Esempio n. 1
0
 public void Execute(ArgumentList arguments, TaskList tasks, TagList tags, TagFolder folder)
 {
     FileIO loader = new FileIO();
     TaskTagger tagTasks = new TaskTagger(tasks.GetTasks());
     if (tagTasks.Untag(arguments.GetParameter(1), arguments.GetParameter(2)))
         loader.SaveTasks(tagTasks.GetTasks());
     else
         Console.WriteLine("No task with that id found to untag");
 }
Esempio n. 2
0
 public void Execute(ArgumentList arguments, TaskList tasks, TagList tags, TagFolder folder)
 {
     FileIO loader = new FileIO();
     TaskTagger tagTasks = new TaskTagger(tasks.GetTasks());
     if (tagTasks.DeleteTag(arguments.GetParameter(1)) || tags.HasTag(arguments.GetParameter(1)))
     {
         Tag tagToRemove = tags.GetTag(tags.GetTagIndex(arguments.GetParameter(1)));
         tags.RemoveTag(ref tagToRemove);
         loader.SaveTags(tags);
         loader.SaveTasks(tagTasks.GetTasks());
         Console.WriteLine("Tag {0} deleted", arguments.GetParameter(1));
     }
     else
         Console.WriteLine("No tag with that name available");
 }
Esempio n. 3
0
 public void Execute(ArgumentList arguments, TaskList tasks, TagList tags, TagFolder folder)
 {
     FileIO loader = new FileIO();
     TaskTagger tagTasks = new TaskTagger(tasks.GetTasks());
     if (arguments.GetLength() == 2)
     {
         Tag tag = new Tag(arguments.GetParameter(1));
         tags.AddTag(ref tag);
         loader.SaveTags(tags);
     }
     else
     {
         if (tagTasks.AssignTag(arguments.GetParameter(1), arguments.GetParameter(2)))
         {
             loader.SaveTasks(tagTasks.GetTasks());
             Tag tag = new Tag(arguments.GetParameter(2));
             tags.AddTag(ref tag);
             loader.SaveTags(tags);
         }
         else
             Console.WriteLine("No task with that id found to tag");
     }
 }