private void RemoveSelectedProjectImp(object obj) { try { ProjDGCollection.Remove(SelectedProject); }catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void AddNewProjectImp(object obj) { try { if (NewProjectName.Equals("")) { throw new Exception("A project name is required."); } foreach (Project proj in ProjDGCollection) { if (proj.ProjectName.Equals(NewProjectName)) { throw new Exception("A project already exists with that name."); } } ProjDGCollection.Add(new Project(NewProjectName, "test", "test")); addNewProjectWindow.Close(); MessageBox.Show("Project successfully created!", "Project Created", MessageBoxButton.OK); }catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }