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); }
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); } } }
public void AddTask(DateTime Date, string task) { ENV.AddToTodayTaskFile(Date, task); this.Tasks.Add(new SingleTask(DateTime.Now.TimeOfDay, task)); }