public void MoveTask(Status from, Status to, Task task, int index) { task.Status = to; switch (from) { case Status.ToDo: ToDoTasks.Remove(task); break; case Status.InProgress: InProgressTasks.Remove(task); break; case Status.Review: InReviewTasks.Remove(task); break; case Status.Completed: CompletedTasks.Remove(task); break; } switch (to) { case Status.ToDo: ToDoTasks.Insert(index, task); HandleReorder(ToDoTasks, task, index, false); break; case Status.InProgress: InProgressTasks.Insert(index, task); HandleReorder(InProgressTasks, task, index, false); break; case Status.Review: InReviewTasks.Insert(index, task); HandleReorder(InReviewTasks, task, index, false); break; case Status.Completed: CompletedTasks.Insert(index, task); HandleReorder(CompletedTasks, task, index, false); break; } DataAccess.UpdateTask(task); }
public void DeleteSelected() { DataAccess.DeleteTask(Selected); switch (Selected.Status) { case Status.ToDo: ToDoTasks.Remove(Selected); break; case Status.InProgress: InProgressTasks.Remove(Selected); break; case Status.Review: InReviewTasks.Remove(Selected); break; case Status.Completed: CompletedTasks.Remove(Selected); break; } Selected = null; }