//------------------------------------------------------------------------- private void uiAddRealisation_Click(object sender, EventArgs e) { try { // Add new entity. Entity entity = ActiveRoadmap.AddEntity <RealisationEntity>(); // Show the entity properties dialog. EntityDlg dlg = new EntityDlg(ActiveRoadmap, entity); if (dlg.ShowDialog(this) == DialogResult.OK) { PopulateEntityList <RealisationEntity>(uiRealisations); uiRealisations.SelectedItem = entity; } else { ActiveRoadmap.RemoveEntity(entity); } dlg.Dispose(); } catch (Exception ex) { Program.HandleException(ex); } }
//------------------------------------------------------------------------- private void uiRealisations_DoubleClick(object sender, EventArgs e) { try { Entity entity = (Entity)uiRealisations.SelectedItem; if (entity != null) { EntityDlg dlg = new EntityDlg(ActiveRoadmap, entity); dlg.ShowDialog(this); dlg.Dispose(); PopulateEntityLists(); uiRealisations.SelectedItem = entity; } } catch (Exception ex) { Program.HandleException(ex); } }