Exemplo n.º 1
0
        //***Start Button***
        private void onSubmitClick(int stgIndex)
        {
            Dictionary <String, String> paras = getStgParas(stgIndex);

            String[] stgNames = appStrategyManager.getStgNames();
            appStrategyManager.startStrategy(stgNames[stgIndex], stgIndex, paras, appStrategyManager.UserAccount, GetMDContract(), getTickerInfo());
            StrategyOnOff onOff = new StrategyOnOff();

            onOff.stgIndex = stgIndex;
            onOff.isOn     = true;
            HandleStrategyOnOff(onOff);
            MessageBox.Show("Strategy Start!");
        }
Exemplo n.º 2
0
 public void HandleStrategyOnOff(StrategyOnOff onOff)
 {
     if (this.InvokeRequired)
     {
         StrategOnOffDelegate callback = new StrategOnOffDelegate(HandleStrategyOnOff);
         this.Invoke(callback, new object[] { onOff });
     }
     else
     {
         Button onOffButton = this.Controls.Find("btn_stg" + (onOff.stgIndex + 1) + "_onoff", true).FirstOrDefault() as Button;
         if (onOff.isOn)
         {
             onOffButton.BackColor = Color.LightGreen;
             onOffButton.Text      = "ON";
         }
         else
         {
             onOffButton.BackColor = Color.Red;
             onOffButton.Text      = "OFF";
         }
     }
 }