public FrmRGSDisplay() { InitializeComponent(); try { this.ds.Merge(Util.robj.get_rgs_conf_table()); this.dataGridView1.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } for (int i = 0; i < ds.tblRGS_Config.Rows.Count; i++) { try { // dataGridView1.Rows[i].Cells["Connected"].Value = Util.robj.IsRGSConnected(dataGridView1.Rows[i].Cells["IP"].Value.ToString()); ds.tblRGS_Config[i].connected = Util.robj.IsRGSConnected(ds.tblRGS_Config[i].ip); } catch(Exception ex) { MessageBox.Show(ex.Message) ; } } this.dataGridView1.Refresh(); try { ncclient = new RemoteInterface.EventNotifyClient(QYClient.Properties.Settings.Default.NotifyServerIP, QYClient.Properties.Settings.Default.NotifyServerPort, false); ncclient.OnConnect += new RemoteInterface.OnConnectEventHandler(ncclient_OnConnect); ncclient.OnEvent += new RemoteInterface.NotifyEventHandler(ncclient_OnEvent); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void FrmCurrentSectionData_Load(object sender, EventArgs e) { try { nclient = new RemoteInterface.EventNotifyClient(QYClient.Properties.Settings.Default.NotifyServerIP,QYClient.Properties.Settings.Default.NotifyServerPort,false); nclient.OnConnect += new RemoteInterface.OnConnectEventHandler(nclient_OnConnect); this.nclient.OnEvent += new RemoteInterface.NotifyEventHandler(nclient_OnEvent); try { this.Text = (Util.robj.get_current_travel_data_time_stamp() == null) ? "" : Util.robj.get_current_travel_data_time_stamp().ToString(); } catch { ; } // this.Text = ds.Tables[0].Rows[0][0].ToString(); ds = Util.robj.get_current_travel_time(); this.dataGridView1.DataSource = ds; this.dataGridView1.DataMember = "tblRGS_Config"; } catch (Exception ex) { MessageBox.Show(ex.Message); try { // this.Dispose(); } catch (Exception ex1) { MessageBox.Show(ex1.Message); } } }
private void Form2_Shown(object sender, EventArgs e) { try { if (mfccid.StartsWith("MFCC_VD")) mfccid = "MFCC_VD"; else if (mfccid.StartsWith("MFCC_CMS")) mfccid = "MFCC_CMS"; else if (mfccid.StartsWith("MFCC_CSLS")) mfccid = "MFCC_CSLS"; robj = (RemoteInterface.MFCC.I_MFCC_Base)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.MFCC.I_MFCC_Base), RemoteInterface.RemoteBuilder.getRemoteUri(ip, port + 1000, mfccid)); robj.setDeviceCommMointer(devName,true); this.nclient = new RemoteInterface.EventNotifyClient(ip, port - 5000, false); nclient.OnConnect += new RemoteInterface.OnConnectEventHandler(nclient_OnConnect); } catch (Exception ex) { MessageBox.Show(ex.Message); try { this.Close(); this.Dispose(); } catch (Exception ex1) { MessageBox.Show(ex1.Message); } } }