예제 #1
0
파일: PanelsForm.cs 프로젝트: slawer/sgt
        /// <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;
                        }
                    }
                }
            }
        }
예제 #2
0
파일: PanelsForm.cs 프로젝트: slawer/sgt
        /// <summary>
        /// добавить общую панель
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            FullPanelForm frm = new FullPanelForm(null);
            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                FullPanel n_panel = frm.FullPanel;
                if (n_panel != null)
                {
                    _app.InsertPanel(n_panel);
                    InsertPanel(n_panel);

                    n_panel.Actualize();
                }
            }
        }