public void loadConfig() { txtAccount.Text = Config.configAccount; List <Pool> mPools = new PoolBLL().getAll(); List <Pool> myPools = new List <Pool>(); if (mPools != null) { mPools.ForEach(i => myPools.Add(i)); } ddlPool.DataSource = myPools; ddlPool.ValueMember = "poolName"; ddlPool.DisplayMember = "poolName"; ddlPool.SelectedValue = Config.configPool; ddlGPU.SelectedIndex = Config.configGPUType; cbStartUp.Checked = Config.configStartUp; }
public void initData() { //ddlPool.Items.Clear(); List <Pool> mPools = new PoolBLL().getAll(); List <Pool> myPools = new List <Pool>(); if (mPools != null) { mPools.ForEach(i => myPools.Add(i)); } myPools.Insert(0, new Pool() { poolName = "Add" }); ddlPool.DataSource = myPools; ddlPool.ValueMember = "poolName"; ddlPool.DisplayMember = "poolName"; if (loadConfigDelegate != null) { loadConfigDelegate(); } }