/// <summary> /// редактируем панель /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (listViewPanels.SelectedItems != null && listViewPanels.SelectedItems.Count > 0) { ListViewItem selected = listViewPanels.SelectedItems[0]; if (selected != null) { VPanel s_panel = selected.Tag as VPanel; if (s_panel != null) { switch (s_panel.VPanelType) { case VPanelType.DrillingFloor: DrillingPanelForm d_frm = new DrillingPanelForm(); d_frm.ShowDialog(this); break; case VPanelType.SolutionPanel: SolutionPanelForm s_frm = new SolutionPanelForm(); s_frm.ShowDialog(this); break; case VPanelType.PanelSpo: SpoPanelForm sp_frm = new SpoPanelForm(); sp_frm.ShowDialog(this); break; case VPanelType.NumericPanel: EditNumericPanelForm frm = new EditNumericPanelForm(s_panel as NumericPanel); if (frm.ShowDialog(this) == DialogResult.OK) { //s_panel.Actualize(); selected.SubItems[1].Text = s_panel.VPanelName; } s_panel.Actualize(); break; case VPanelType.FullPanel: FullPanelForm full_frm = new FullPanelForm(s_panel as FullPanel); if (full_frm.ShowDialog(this) == DialogResult.OK) { selected.SubItems[1].Text = s_panel.VPanelName; } s_panel.Actualize(); break; default: break; } } } } }