public void AddTask(Task task) { this._taskStore.AddTask(task); if (this.TaskAdded != null) this.TaskAdded(this, new TaskAddedEventArgs(task)); }
public string DetermineBucket(Task t) { foreach(var bucket in this.buckets) if(bucket.IsInBucket(t)) return bucket.GetBucketName(); return string.Empty; }
public virtual void UpdateTask(Task task) { var toUpdate = GetById(task.TaskId); toUpdate.IsCompleted = task.IsCompleted; toUpdate.Category = task.Category; toUpdate.What = task.What; toUpdate.When = task.When; toUpdate.Where = task.Where; }
public void test_task_in_tomorrow_bucket() { var strategy = new TaskBucketingStrategy(); var task = new Task() { When = DateTime.Now.AddDays(1) }; var result = strategy.DetermineBucket(task); Assert.AreEqual("Tomorrow", result); }
public void test_task_in_today_bucket() { var strategy = new TaskBucketingStrategy(); var task = new Task() { When = DateTime.Now }; var result = strategy.DetermineBucket(task); Assert.AreEqual("Today", result); }
public void AddTaskToTaskView(string heading, Task task) { //var groupView = this.taskPanel.FindName( // heading.Replace(" ", "_")) // as TimeGroupedTaskView; var groupView = (from c in taskPanel.Children.Cast<TimeGroupedTaskView>() where c.Name == heading.Replace(" ", "_") select c).SingleOrDefault(); groupView = this.taskPanel.Children[0] as TimeGroupedTaskView; var tasks = groupView.Tasks; tasks.Add(task); //groupView.Tasks = null; //groupView.Tasks = tasks; }
public void AddTask() { if (IsValid(window)) { Task task = new Task() { IsCompleted = false, When = ToDateTime(window.When), Where = window.Where, What = window.What, Category = window.Category }; this._repository.AddTask(task); window.AddTaskToTaskView(GetGroupHeading(task.When), task); window.ResetInput(); window.InitialFocus(); window.HighlightNewTask(); } else { window.ShowErrorPrompt("Please enter all of the required fields."); } }
public TaskAddedEventArgs(Task newTask) { this.NewTask = newTask; }
public virtual void DeleteTask(Task t) { var toDelete = GetById(t.TaskId); this._tasks.Remove(toDelete); toDelete = null; }
public virtual int AddTask(Task t) { t.TaskId = ++this._lastId; _tasks.Add(t); return this._lastId; }
public void SaveTask() { var task = new Task() { What = this.What, Where = this.Where, When = this.When }; _repository.AddTask(task); this.Tasks.Add(task); }
public void UpdateTask(Task task) { }
public virtual bool IsInBucket(Task task) { return isInBucketFunc(task); }
public void UpdateTask(Task t) { throw new NotImplementedException(); }
public int AddTask(Task t) { throw new NotImplementedException(); }