private void BindDbConfig() { string str = IniConfigHelper.ReadDefaultDBInfo(); string currentName = ""; foreach (DbConfigInfo dc in _dbConfigList) { if (!_dbConfigDic.ContainsKey(dc.DbConfigName)) { _tscbDbConfig.Items.Add(dc.DbConfigName); _dbConfigDic.Add(dc.DbConfigName, dc); } if (dc.DbId == str) { currentName = dc.DbConfigName; } } if (_dbConfigList != null && _dbConfigList.Count > 0) { if (string.IsNullOrEmpty(_tscbDbConfig.Text)) { if (string.IsNullOrEmpty(currentName)) { _tscbDbConfig.Text = _dbConfigList[0].DbConfigName; } else { _tscbDbConfig.Text = currentName; } } } }
private void init() { isInit = true; clear(); CsharpCodeGenConfig.Clear(); string str = IniConfigHelper.ReadDefaultDBInfo(); IList <CsharpCodeGenConfig> tem = IniConfigHelper.ReadDBInfo(); CsharpCodeGenConfig.Clear(); clearCbUI(); addItem(""); foreach (CsharpCodeGenConfig config in tem) { if (!CsharpCodeGenConfig.ContainsKey(config.DisplayName)) { CsharpCodeGenConfig.Add(config.DisplayName, config); addItem(config.DisplayName); } } if (string.IsNullOrEmpty(str)) { clear(); } else { if (CsharpCodeGenConfig.Count > 0) { foreach (string key in CsharpCodeGenConfig.Keys) { if (key.Equals(str)) { CsharpCodeGenConfig[key].IsDelete = false; setUI(CsharpCodeGenConfig[key]); setCbText(CsharpCodeGenConfig[key].DisplayName); } } } } isInit = false; }