private void iniFrm() { try { GDBConnection gdbc = new GDBConnection(); gdbc.iniSys(); winCom.cDealForm.CIniGrid cIGrd = new winCom.cDealForm.CIniGrid(); this.dataGrid1.ReadOnly = true; if (cIGrd.iniDataGrid(this.dataGrid1, 1) == false) { } winCom.cDealForm.CIniGrid.getGprsDataTable(ref this.m_dtSave); this.m_timeSave = new System.Timers.Timer(); this.m_timeSave.Elapsed += new System.Timers.ElapsedEventHandler(m_timeSave_Elapsed); this.m_timeSave.Interval = 1000; this.m_timeSave.Start(); XmlDocument xDoc = new XmlDocument(); xDoc.Load("farCmd.xml"); XmlNode xNodeFarCmd = xDoc.DocumentElement.SelectSingleNode("./farCmd"); for (int i = 0; i < xNodeFarCmd.ChildNodes.Count; i++) { string strDes = xNodeFarCmd.ChildNodes[i].Attributes.GetNamedItem("des").Value.Trim(); this.cmbInfo.Items.Add(strDes); } winCom.cDealForm.CDFrm.paintWell("", this.trvZhan); this.removeZhanCe(this.trvZhan); xDoc.Load("comInfo.xml"); string strInter = xDoc.DocumentElement.SelectSingleNode("./onTimeInter").Attributes.GetNamedItem("val").Value.Trim(); this.timer1.Interval = int.Parse(strInter); this.timer1.Tick += new EventHandler(timer1_Tick); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void iniFrm() { try { GDBConnection gdbc=new GDBConnection(); gdbc.iniSys(); winCom.cDealForm.CIniGrid cIGrd=new winCom.cDealForm.CIniGrid(); this.dataGrid1.ReadOnly=true; if(cIGrd.iniDataGrid(this.dataGrid1,1)==false) { } winCom.cDealForm.CIniGrid.getGprsDataTable(ref this.m_dtSave); this.m_timeSave=new System.Timers.Timer(); this.m_timeSave.Elapsed+=new System.Timers.ElapsedEventHandler(m_timeSave_Elapsed); this.m_timeSave.Interval=1000; this.m_timeSave.Start(); XmlDocument xDoc=new XmlDocument(); xDoc.Load("farCmd.xml"); XmlNode xNodeFarCmd=xDoc.DocumentElement.SelectSingleNode("./farCmd"); for(int i=0;i<xNodeFarCmd.ChildNodes.Count;i++) { string strDes=xNodeFarCmd.ChildNodes[i].Attributes.GetNamedItem("des").Value.Trim(); this.cmbInfo.Items.Add(strDes); } winCom.cDealForm.CDFrm.paintWell("",this.trvZhan); this.removeZhanCe(this.trvZhan); xDoc.Load("comInfo.xml"); string strInter=xDoc.DocumentElement.SelectSingleNode("./onTimeInter").Attributes.GetNamedItem("val").Value.Trim(); this.timer1.Interval=int.Parse(strInter); this.timer1.Tick +=new EventHandler(timer1_Tick); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } }