예제 #1
0
파일: Main.cs 프로젝트: grae22/Roadmap
        //-------------------------------------------------------------------------

        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);
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: grae22/Roadmap
        //-------------------------------------------------------------------------

        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);
            }
        }