Exemplo n.º 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;
            }
Exemplo n.º 2
0
 private void OnStopGateway(object sender, EventArgs e)
 {
     this.btnStart.Enabled = true;
     this.btnStop.Enabled  = false;
     ActiveGateway.Stop();
 }
Exemplo n.º 3
0
 private void OnRefresh(object sender, EventArgs e)
 {
     ActiveGateway.Refresh();
 }