private void btnAddProject_Click(object sender, EventArgs e) { ProjectForm projectForm = new ProjectForm(_dataStore.Projects); projectForm.SaveComplete += save_Clicked; projectForm.Show(); }
private void BtnEditProject_Click(object sender, EventArgs e) { // call the constructor that will initiate an edit instead of an add ProjectForm projectForm = new ProjectForm(_dataStore.Projects, _selectedProjectId); // attach the event listener, SaveAndReload, to the DoSave event projectForm.DoSave += SaveAndReload; projectForm.Show(); }
private void BtnAddProject_Click(object sender, EventArgs e) { ProjectForm projectForm = new ProjectForm(_dataStore.Projects); // attach the event listener, SaveAndReload, to the // project form's DoSave event, the code in SaveAndReload // will get executed when the event is raised projectForm.DoSave += SaveAndReload; projectForm.Show(); }