using IntelligentControlForsx.CodeGenerator; using log4net; using System; using System.Collections; using System.ComponentModel; using System.Threading; using System.Windows.Forms; using WisdomClient.data; using WisdomClient; using System.Collections.Generic; namespace IntelligentControlForsx.MyControls { public partial class WindturbineParams : UserControl { private ILog logger = LogManager.GetLogger("AppInfoLog"); #region 数据绑定 // This BindingSource binds the list to the DataGridView control. private BindingSource bindingSource = new BindingSource(); private IDictionary> dictBindingList; private BindingList getBindingList(string clsName) { if (dictBindingList == null) dictBindingList = new Dictionary>(); if (dictBindingList.ContainsKey(clsName) == false) { BindingList bl = createParamList(clsName); dictBindingList.Add(clsName, bl); } return dictBindingList[clsName]; } private string stationId; public string StationId { get { return stationId; } set { if (value != this.stationId) { this.stationId = value; // Bind the list to the BindingSource. this.bindingSource.DataSource = getBindingList(stationId); // Attach the BindingSource to the DataGridView. this.gvWindturbine.DataSource = this.bindingSource; } } } public WindturbineParams() { InitializeComponent(); } private BindingList createParamList(string stationId) { BindingList paramList = new BindingList(); ArrayList tmArray = TableModelFactory.Instance.getTableModel(stationId); for (int i=0;i