Пример #1
0
 void SetlblCurIteration()
 {
     if (this.lblIteration.InvokeRequired)
     {
         ArgReturningVoidDelegate d = new ArgReturningVoidDelegate(SetlblCurIteration);
         this.Invoke(d);
     }
     else
     {
         this.lblIteration.Refresh();
     }
 }
Пример #2
0
 public void setControl()
 {
     if (this.spinBox.InvokeRequired)
     {
         ArgReturningVoidDelegate ar = new ArgReturningVoidDelegate(setControl);
         spinBox.Invoke(ar);
     }
     else
     {
         this.spinBox.Value++;
     }
 }
Пример #3
0
 public void setControl()
 {
     if (this.listBox.InvokeRequired)
     {
         ArgReturningVoidDelegate ar = new ArgReturningVoidDelegate(setControl);
         listBox.Invoke(ar);
     }
     else
     {
         //DateTime currDateTime = e.currentTime;
         listBox.Items.Add(currDateTime.ToString());
     }
 }
Пример #4
0
 /// <summary>
 /// Обновление статистики
 /// </summary>
 public void UpdateStat()
 {
     if (this.dataGridView1.InvokeRequired)
     {
         ArgReturningVoidDelegate d = new ArgReturningVoidDelegate(UpdateStat);
         this.Invoke(d);
     }
     else
     {
         this.dataGridView1.Rows.Clear();
         ArrayList Arr = presenter.GetArrayList();
         for (int i = 0; i < Arr.Count; i++)
         {
             this.dataGridView1.Rows.Add();
             this.dataGridView1[0, i].Value = ((TruckSimulator.Point)(Arr[i])).GetType().Name + ((TruckSimulator.Point)(Arr[i])).Name.ToString();
             this.dataGridView1[1, i].Value = ((TruckSimulator.ITruck)(Arr[i])).Fuelbalance;
         }
         lblIteration.Text = this.presenter.Map.CurIteration.ToString();
         this.Invalidate();
     }
 }
Пример #5
0
        public void MyRefresh()
        {
            if (this.chart.InvokeRequired)
            {
                ArgReturningVoidDelegate d = new ArgReturningVoidDelegate(MyRefresh);
                this.Invoke(d);
            }
            else
            {
                PrepareChart();

                data = Program.allSymbols;


                int top  = 10;
                int left = 150;

                lock (this)
                {
                    try
                    {
                        foreach (var item in data)
                        {
                            Button button = new Button();
                            button.Left   = left;
                            button.Top    = top;
                            button.Text   = item.Key;
                            button.Click += (sender, e) => myButtonClickFunction(sender, e, item.Key);

                            this.Controls.Add(button);
                            left += button.Width + 5;
                        }
                    }
                    catch
                    {
                        MyRefresh();
                    }
                }
            }
        }