public ScheduleSnapshot TakeSnapshot()
 {
     return(new ScheduleSnapshot(Id, CurrentVersion)
     {
         ScheduleName = ScheduleName,
         Todos = Todos.Select(t => new ScheduleSnapshot.TodoSnapshot()
         {
             Id = t.Id,
             Text = t.Text,
             IsCompleted = t.IsCompleted
         }).ToList()
     });
 }
示例#2
0
 public async Task Save(Todo todo, string text)
 {
     todo.Title = text;
     Todos      = Todos.Select(oldTodo => oldTodo.Id.Equals(todo.Id) ? new Todo(oldTodo.Id, text) : oldTodo).ToList();
     await Inform();
 }
示例#3
0
 public async Task Toggle(Todo todoToToggle)
 {
     Todos = Todos.Select(todo => !todo.Id.Equals(todoToToggle.Id) ? todo : new Todo(todo.Id, todo.Title, !todo.Completed)).ToList();
     await Inform();
 }
示例#4
0
 public async Task ToggleAll(bool isCompleted)
 {
     Todos = Todos.Select(todo => new Todo(todo.Id, todo.Title, isCompleted)).ToList();
     await Inform();
 }