コード例 #1
0
        public void AddTask(Task task)
        {
            this._taskStore.AddTask(task);

            if (this.TaskAdded != null)
                this.TaskAdded(this, new TaskAddedEventArgs(task));
        }
コード例 #2
0
 public string DetermineBucket(Task t)
 {
     foreach(var bucket in this.buckets)
         if(bucket.IsInBucket(t))
             return bucket.GetBucketName();
     return string.Empty;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: Main.xaml.cs プロジェクト: gartdan/StopForgetting
        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;
        }
コード例 #7
0
 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.");
     }
 }
コード例 #8
0
 public TaskAddedEventArgs(Task newTask)
 {
     this.NewTask = newTask;
 }
コード例 #9
0
 public virtual void DeleteTask(Task t)
 {
     var toDelete = GetById(t.TaskId);
     this._tasks.Remove(toDelete);
     toDelete = null;
 }
コード例 #10
0
 public virtual int AddTask(Task t)
 {
     t.TaskId = ++this._lastId;
     _tasks.Add(t);
     return this._lastId;
 }
コード例 #11
0
 public void SaveTask()
 {
     var task = new Task()
     {
         What = this.What,
         Where = this.Where,
         When = this.When
     };
     _repository.AddTask(task);
     this.Tasks.Add(task);
 }
コード例 #12
0
 public void UpdateTask(Task task)
 {
 }
コード例 #13
0
 public virtual bool IsInBucket(Task task)
 {
     return isInBucketFunc(task);
 }
コード例 #14
0
 public void UpdateTask(Task t)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 public int AddTask(Task t)
 {
     throw new NotImplementedException();
 }