示例#1
0
 public void Execute(ArgumentList arguments, TaskList tasklist, TagList tags, TagFolder folder)
 {
     ILister lister = new Lister();
     if (arguments.GetParameter(arguments.GetLength() - 1) == "--export")
         lister = new HtmlLister();
     if (arguments.GetLength() == 1 || arguments.GetParameter(1) == "--export")
         lister.ListNotDone(tasklist.GetTasks(), string.Empty);
     else if (arguments.GetParameter(1) == "all")
         lister.ListAllTasks(tasklist.GetTasks());
     else if (arguments.GetParameter(1) == "tags")
         lister.ListTags(tags, tasklist);
 }
示例#2
0
 public void Execute(ArgumentList arguments, TaskList tasks, TagList tags, TagFolder folder)
 {
     ILister lister = new Lister();
     if (arguments.GetParameter(arguments.GetLength() - 1) == "--export")
         lister = new HtmlLister();
     if (arguments.GetLength() == 1 || arguments.GetParameter(1) == "--export")
         lister.ListNotDone(tasks.FilterDue("past"), string.Empty);
     else if (arguments.GetParameter(1) == "today")
         lister.ListNotDone(tasks.FilterDue("today"), string.Empty);
     else if (arguments.GetParameter(1) == "thisWeek")
         lister.ListNotDone(tasks.FilterDue("thisWeek"), string.Empty);
     else if (arguments.GetParameter(1) == "nextWeek")
         lister.ListNotDone(tasks.FilterDue("nextWeek"), string.Empty);
 }
 public void Execute(ArgumentList arguments, TaskList tasklist, TagList tags, TagFolder folder)
 {
     ILister lister = new Lister();
     if (arguments.GetParameter(arguments.GetLength() - 1) == "--export")
         lister = new HtmlLister();
     lister.ListFiltered(tasklist.FilterTasks(arguments.GetParameter(1)), arguments.GetParameter(1));
 }
示例#4
0
        private static Task CheckDueDate(ArgumentList arguments, Task task)
        {
            if (arguments.GetLength() == 3)
            {
                task.DueDate = Convert.ToDateTime(arguments.GetParameter(2));
                if (task.DueDate < DateTime.Today)
                    Console.WriteLine("Warning, the due date is in the past");
            }

            return task;
        }
 public void Execute(ArgumentList arguments, TaskList tasks, TagList tags, TagFolder folder)
 {
     FileIO loader = new FileIO();
     if (arguments.GetLength() == 2)
     {
         folder.FolderName = arguments.GetParameter(1);
         loader.SaveFolder(folder);
     }
     else if (arguments.GetLength() == 3 && arguments.GetParameter(1) == "tag")
     {
         Tag toAdd = new Tag(arguments.GetParameter(2));
         folder.AddTag(ref toAdd);
         loader.SaveFolder(folder);
     }
     else if (arguments.GetLength() == 3 && arguments.GetParameter(1) == "subfolder")
     {
         TagFolder toAdd = new TagFolder(arguments.GetParameter(2));
         folder.AddSubfolder(toAdd);
         loader.SaveFolder(folder);
     }
     else if (arguments.GetLength() == 5 && arguments.GetParameter(1) == "subfolder" && arguments.GetParameter(3) == "tag")
     {
         Tag toAdd = new Tag(arguments.GetParameter(4));
         TagFolder copy = folder.GetSubfolder(arguments.GetParameter(2));
         copy.AddTag(ref toAdd);
         folder.ReplaceSubFolder(folder.GetSubfolder(arguments.GetParameter(2)), copy);
         loader.SaveFolder(folder);
     }
     else if (arguments.GetLength() == 5 && arguments.GetParameter(1) == "subfolder" && arguments.GetParameter(3) == "subfolder")
     {
         TagFolder toAdd = new TagFolder(arguments.GetParameter(4));
         TagFolder copy = folder.GetSubfolder(arguments.GetParameter(2));
         copy.AddSubfolder(toAdd);
         folder.ReplaceSubFolder(folder.GetSubfolder(arguments.GetParameter(2)), copy);
         loader.SaveFolder(folder);
     }
 }
示例#6
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");
     }
 }
示例#7
0
 public void Execute(ArgumentList arguments, TaskList tasklist, TagList tags, TagFolder folder)
 {
     if (arguments.GetLength() == 1)
         Program.DisplayHelp();
 }