private void FromWDM_Load(object sender, EventArgs e) { //this.wdmFile = WDMIntegrationModule.getWDMDBFilePath(); //if (wdmFile == "") //{ // return; //} this.airs = WDMIntegrationModule.getAircs(); if (this.airs == null) { MessageBox.Show("机型没有读取成功,请检查参数配置."); this.Close(); return; } TreeNode parentNode = new TreeNode("WDM机型列表"); this.WDMTree.Nodes.Add(parentNode); for (int i = 0; i < airs.Length; i++) { TreeNode childNode = new TreeNode(); childNode.Name = airs[i].ID; childNode.Text = airs[i].MC; childNode.Tag = i; parentNode.Nodes.Add(childNode); } this.WDMTree.ExpandAll(); }
private void FromWDM_Load(object sender, EventArgs e) { this.wdmFile = CommonUtil.getWDMDBFilePath(); if (wdmFile == "") { return; } this.airs = WDMIntegrationModule.getAircs(wdmFile); TreeNode parentNode = new TreeNode("WDM机型列表"); this.WDMTree.Nodes.Add(parentNode); for (int i = 0; i < airs.Length; i++) { TreeNode childNode = new TreeNode(); childNode.Name = airs[i].ID; childNode.Text = airs[i].MC; childNode.Tag = i; parentNode.Nodes.Add(childNode); } this.WDMTree.ExpandAll(); }
private void loadWDMDB() { this.airs = WDMIntegrationModule.getAircs();//取数据源动作 string msg = ""; if (this.airs == null) { msg = "机型没有读取成功,请检查参数配置."; } //else //{ // TreeNode parentNode = new TreeNode("WDM机型列表"); // this.WDMTree.Nodes.Add(parentNode); // for (int i = 0; i < airs.Length; i++) // { // TreeNode childNode = new TreeNode(); // childNode.Name = airs[i].ID; // childNode.Text = airs[i].MC; // childNode.Tag = i; // parentNode.Nodes.Add(childNode); // } // this.WDMTree.ExpandAll(); //} //执行回调. if (this.InvokeRequired) { CallBackDelegate cbd = new CallBackDelegate(callBack); this.BeginInvoke(cbd, msg); //异步调用回调 //this.Invoke(cbd, msg); //同步调用回调 } else { this.Close(); } }