private void EditSimulation(ListViewItem item) { if (item.Tag is SimulationTemplateDefinition template) { using (var gridForm = new PropertyGridForm("Edit Simulation")) { gridForm.PropertyGrid.SelectedObject = template; if (gridForm.ShowDialog() == DialogResult.OK) { } } } }
private void menuNewSimulation_Click(object sender, EventArgs e) { using (var gridForm = new PropertyGridForm("New Simulation")) { var simulationDefinition = new SimulationTemplateDefinition(Workspace); gridForm.PropertyGrid.SelectedObject = simulationDefinition; gridForm.OKAction = () => { Workspace.SimulationTemplates.Add(simulationDefinition); Add(simulationDefinition); }; gridForm.ShowDialog(); } }