public Form1() { InitializeComponent(); this.FormClosing += Form1_FormClosing; _updateUIDelegate = new updateUIDelegate(updateUI); label1.Text = "X"; label2.Text = "Y"; label3.Text = "Z"; label4.Text = ""; label5.Text = ""; label6.Text = ""; progressBar1.Maximum = maxRange; progressBar2.Maximum = maxRange; progressBar3.Maximum = maxRange; this.Text = "Freipost Hardware Demo"; try { us = new UltrasonicSensor(); } catch (Exception e) { MessageBox.Show("Device could not be found " + e.Message); this.Close(); } timer = new Timer(); timer.Interval = 1000; timer.Tick += Timer_Tick; timer.Start(); }
private void UIHandler() { updateUIDelegate updateUI = new updateUIDelegate(UIControl); while (true) { Thread.Sleep(Utils.timeInterval); this.Dispatcher.Invoke(updateUI, sliverDataContainer); } }
private void UIHandler() { updateUIDelegate updateUIDelegateImpl = new updateUIDelegate(UIControl); while (true) { Thread.Sleep(Utils.timeInterval); this.Dispatcher.Invoke(updateUIDelegateImpl, mainDevDataContains); } }
public void test(asyncCallback callbackMethod) { updateUIDelegate del = new updateUIDelegate(updateUI); del.BeginInvoke(true, null, null); if (callbackMethod != null) { callback(); } }
public Form1() { InitializeComponent(); cgr = new CGRWorker(); ui = new updateUIDelegate(updateUI); cgr.repeat = CGRWorker.RepeatType.Indefinite; rdbIndefinite.Checked = true; rdbSetNumber_CheckedChanged(null, null); startCheck(); }