private void addButton_Click(object sender, EventArgs e) { ChoreFactory factory = new ChoreFactory(); Chore newChore = factory.Generate("", "", 0.50); EditChoreForm form = new EditChoreForm(newChore); form.ShowDialog(); if (form.SavedChore.IsEmpty == false) { AddChoreToView(form.SavedChore); } }
private void EditSelected() { if (choresListview.SelectedItems.Count == 1) { ListViewItem listviewitem = choresListview.SelectedItems[0]; Chore chore = (Chore)listviewitem.Tag; EditChoreForm form = new EditChoreForm(chore); form.ShowDialog(); if (form.SavedChore.IsEmpty == false) { UpdateChoreInView(form.SavedChore); } } }