public void New(Func <bool> askIfSure) { if (UnsavedChanges) { if (!askIfSure()) { return; } } _addressManager.DeleteAll(); _estateManager.DeleteAll(); UnsavedChanges = false; }
private void mnuNew_Click(object sender, EventArgs e) { DialogResult NewDialog = MessageBox.Show("Are u sure u want to do this?", "New", MessageBoxButtons.OK); if (NewDialog == DialogResult.OK) { Em.DeleteAll(); fileName = null; Update(); } else { Update(); } }
/// <summary> /// Deletes all the estates in the estates ArrayList. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDeleteAll_Click(object sender, EventArgs e) { estateManager.DeleteAll(); dictionaryHandler.ClearAll(); }