public ToDoListPresenter(IToDoList view, IToDoListRepository repository) { this.view = view; this.repository = repository; view.Add += AddItem; view.Remove += DeleteItem; view.UpdateList(repository.GetAllTasks()); }
public static void AddTask() { var dialog = new AddForm(); var dialogPresenter = new AddTaskPresenter(dialog, repository); var result = dialog.ShowDialog(); if (result == DialogResult.OK) { view.UpdateList(repository.GetAllTasks()); } }
public void DeleteItem(string Id) { repository.RemoveTask(Id); view.UpdateList(repository.GetAllTasks()); }
public void RemoveItem(string id) { repository.RemoveTask(id); view.UpdateList(repository.GetAllTasks()); }