示例#1
0
        private void DeleteTaskButton_Click(object sender, EventArgs e)
        {
            DeleteForm DeleteTask = new DeleteForm();

            DeleteTask.ShowDialog();
            if (DeleteTask.IndexofTask > 0 && DeleteTask.IndexofTask <= todo.TodayTasks.Tasks.Count)
            {
                todo.TodayTasks.Tasks.RemoveAt(DeleteTask.IndexofTask - 1);
            }
            ENV.UpdateTodayTaskFile(todo.TodayTasks);
            displayTaskInTextArea(todo.TodayTasks);
        }
示例#2
0
 public Task(DateTime date)
 {
     Date  = date;
     Tasks = new List <SingleTask>();
     if (ENV.IsTodayTaskFileExist(date))
     {
         Tasks = ENV.GetTodayTaskFile(date);
     }
     else
     {
         if (Date.Date >= DateTime.Now.Date)
         {
             ENV.CreateTodaysTaskFile(Date);
         }
     }
 }
示例#3
0
 public void AddTask(DateTime Date, string task)
 {
     ENV.AddToTodayTaskFile(Date, task);
     this.Tasks.Add(new SingleTask(DateTime.Now.TimeOfDay, task));
 }