Пример #1
0
        private void DeleteRow(int index)
        {
            int TotalCount = 0;

            TotalCount = Dgv_Sum.RowCount;

            Dgv_Sum.Rows.Remove(Dgv_Sum.Rows[index]);

            //关闭要删除的窗口
            if (GlobalValue.connectvalue[index].InstrForm != null)
            {
                GlobalValue.connectvalue[index].InstrForm.Close();
            }
            //元素依次前挪
            for (int i = index; i < TotalCount - 1; i++)
            {
                GlobalValue.connectvalue[i] = GlobalValue.connectvalue[i + 1];
                if (GlobalValue.connectvalue[i].InstrForm != null)
                {
                    //GlobalValue.connectvalue[i].InstrForm.formindex = i;
                }
                if (EnableReg == true)
                {
                    //更新reg
                    //GlobalValue.connectvalue[i].SaveSettingInReg(i);
                }
            }
            //清除最后一个元素
            GlobalValue.connectvalue[TotalCount - 1].Setnull();

            if (EnableReg == true)
            {
                GlobalValue.RegPathDelete("Software\\SiemensSimulator\\", index.ToString());
                UpdateReg(Dgv_Sum.RowCount);
            }
        }
Пример #2
0
 private void B_Clean_Click(object sender, EventArgs e)
 {
     GlobalValue.RegPathDelete("Software\\", "SiemensSimulator");
 }