Esempio n. 1
0
 private void btnCheck_Click(object sender, EventArgs e)
 {
     foreach (Control ctl in panel1.Controls)
     {
         KeyValueUI kvUi = ctl as KeyValueUI;
         kvUi.Used = !kvUi.Used;
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 加载UI
        /// </summary>
        /// <param name="filePath"></param>
        private void LoadUI(string filePath)
        {
            ConfigReader configReader       = new ConfigReader(filePath);
            Dictionary <string, string> dic = configReader.ReadConfig(ConfigType.appSettings.ToString(), string.Empty);

            foreach (KeyValuePair <string, string> kv in dic)
            {
                KeyValueUI kvUi = new KeyValueUI();
                kvUi.Dock     = DockStyle.Top;
                kvUi.ShowUsed = true;
                kvUi.UKey     = kv.Key;
                kvUi.UValue   = kv.Value;
                panel1.Controls.Add(kvUi);
            }
        }
Esempio n. 3
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     foreach (Control ctl in panel1.Controls)
     {
         KeyValueUI kvUi = ctl as KeyValueUI;
         if (kvUi.Used)
         {
             SelectedData.Add(new ConfigData()
             {
                 ConfigPath = _configPath,
                 KeyVal     = kvUi.UKey,
                 ValueVal   = kvUi.UValue,
                 TypeVal    = ConfigType.appSettings
             });
         }
     }
     DialogResult = DialogResult.OK;
 }