예제 #1
0
        //载入列表
        private void LoadList()
        {
            RegistryKey key;
            int         TotalCount;

            key = Registry.CurrentUser.OpenSubKey("Software\\SiemensSimulator\\", true);
            if (key == null)
            {
                return;
            }
            TotalCount = Convert.ToInt32(key.GetValue("Count", 0));
            //清理之前所有行
            foreach (DataGridViewRow i in Dgv_Sum.Rows)
            {
                DeleteRow(i.Index);
            }
            for (int i = 0; i < TotalCount; i++)
            {
                NewIndex = Dgv_Sum.Rows.Add();
                //GlobalValue.connectvalue[NewIndex].LoadSettingFromReg(NewIndex);
                Dgv_Sum.Rows[NewIndex].Cells["Instrument"].Value = GlobalValue.connectvalue[NewIndex].FormName;
                GlobalValue.connectvalue[NewIndex].IsHiden       = true;
                //自动开始
                if (GlobalValue.connectvalue[NewIndex].FormEnable == true)
                {
                    TranslateUnit instr = new TranslateUnit(NewIndex);
                    instr.Show();
                    GlobalValue.connectvalue[NewIndex].IsHiden = false;
                    instr.LoadSetting(NewIndex);
                    StartStop(NewIndex);
                }
            }
            key.Close();
        }
예제 #2
0
 private void ShowHiden(int index)
 {
     if (GlobalValue.connectvalue[index].InstrForm == null)
     {
         TranslateUnit instr = new TranslateUnit(index);
         instr.Show();
         instr.LoadSetting(index);
         return;
     }
     if (GlobalValue.connectvalue[index].IsHiden == true)
     {
         GlobalValue.connectvalue[index].InstrForm.Show();
         GlobalValue.connectvalue[index].IsHiden    = false;
         GlobalValue.connectvalue[index].FormEnable = true;
     }
     else
     {
         GlobalValue.connectvalue[index].InstrForm.Hide();
         GlobalValue.connectvalue[index].IsHiden = true;
     }
 }