public bool ReadData(string source) { if (!File.Exists(source)) { return(false); } _sourse = source; StreamReader sr = new StreamReader(source); string line; while ((line = sr.ReadLine()) != null) { string[] fields = line.Split('|'); TaskEntry task = new TaskEntry(); task.Name = fields[1]; task.TaskDate = (fields[2] != "") ? (DateTime?)Convert.ToDateTime(fields[2]) : null; task.IsDone = (fields[0] == "1"); AddTask(task); } sr.Close(); return(true); }
private void buttonAdd_Click(object sender, EventArgs e) { FormAdd addForm = new FormAdd(); if (addForm.ShowDialog() == DialogResult.OK) { TaskEntry task = new TaskEntry(); task.Name = addForm.Name; task.TaskDate = (DateTime?)addForm.TaskDate; task.IsDone = addForm.IsDone; AddTask(task); } }
private void AddTask(TaskEntry task) { _manager.AddTask(task); // bindingSourceTasks.ResetBindings(false); UpdateTable(); }
public bool Filter(TaskEntry task) { return(!task.IsOverdue); }
public bool Filter(TaskEntry task) { return(!task.IsDone); }
public void AddTask(TaskEntry task) { _entries.Add(task); }