예제 #1
0
            private void OnDoWork(object sender, DoWorkEventArgs e)
            {
                //Asynchronous call from the worker with each tick of the timer
                //Tell the gateway to go read the latest data on this background thread
                //Then marshall back to the main thread
                DataSet ds = ActiveGateway.GetData();

                if (ds != null && ds.Tables["DataTable"] != null && ds.Tables["DataTable"].Rows.Count > 0)
                {
                    ds.Tables["DataTable"].Rows[0]["OnDoWorkThreadId"] = Thread.CurrentThread.ManagedThreadId.ToString();
                }
                e.Result = ds;
            }
예제 #2
0
 private void OnStopGateway(object sender, EventArgs e)
 {
     this.btnStart.Enabled = true;
     this.btnStop.Enabled  = false;
     ActiveGateway.Stop();
 }
예제 #3
0
 private void OnRefresh(object sender, EventArgs e)
 {
     ActiveGateway.Refresh();
 }