Esempio n. 1
0
        public FrmRGSStatus()
        {
            InitializeComponent();
            try
            {
                this.ds.Merge(Util.robj.get_all_rgs_display_status());
            }
            catch (Exception ex)
            {
              MessageBox.Show( ex.Message);
            }
            try
            {
                this.dgv.DataSource = this.dgv.DataSource;
                this.dgv.Refresh();
            }
            catch
            {
                ;
            }

            nclient = new RemoteInterface.EventNotifyClient(QYClient.Properties.Settings.Default.NotifyServerIP,
                QYClient.Properties.Settings.Default.NotifyServerPort, true);
            nclient.OnConnect += new RemoteInterface.OnConnectEventHandler(nclient_OnConnect);

            //for (int i = 0; i < dgv.RowCount; i++)
            //{
            //    dgv.Rows[i].Cells["Display"].Value = new QYClient.RgsGenericCtl();
            //    dgv.Rows[i].Cells["Display"].ValueType = typeof(QYClient.RgsGenericCtl);
            //}
        }
Esempio n. 2
0
        public FrmRmsStatus()
        {
            InitializeComponent();
            try
            {
                this.ds.tblRMSMode.AddtblRMSModeRow(0, "固定時制");
                // this.ds.tblRMSMode.AddtblRMSModeRow(1, "區域交通反應");
                this.ds.tblRMSMode.AddtblRMSModeRow(2, "預設時制");
               this.ds.Merge(Util.robj.get_rms_config());
               this.dataGridView1.DataSource = ds;
               this.dataGridView1.Refresh();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            try
            {
                nclient = new RemoteInterface.EventNotifyClient(QYClient.Properties.Settings.Default.NotifyServerIP, QYClient.Properties.Settings.Default.NotifyServerPort, false);
                nclient.OnConnect += new RemoteInterface.OnConnectEventHandler(nclient_OnConnect);

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 3
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            (sender as Timer).Stop();
             //   (sender as Timer).Enabled = false;
            IPHostEntry hostEntry;

            hostEntry = Dns.GetHostEntry(Properties.Settings.Default.ServiceIP);
            string DestIP ="";

            foreach( var  entry in hostEntry.AddressList)
            {
                if(!(entry.IsIPv6LinkLocal || entry.IsIPv6Multicast || entry.IsIPv6SiteLocal))
                {
                    DestIP=entry.ToString();
                    NotifyMessage mesg = new NotifyMessage() { TimeStamp = DateTime.Now, title = "SYS", text = "Get Server IP " + DestIP };
                    this.BeginInvoke(new InvokeDelegate(InvokeTask), mesg);
                    break;
                }

            }
             //   = hostEntry.AddressList[0].ToString();
            nClient = new RemoteInterface.EventNotifyClient(
             DestIP, 9091, true
               );
            nClient.OnEvent += new RemoteInterface.NotifyEventHandler(nClient_OnEvent);
            nClient.OnConnect += new RemoteInterface.OnConnectEventHandler(nClient_OnConnect);
            ShowNormals();
        }