Beispiel #1
0
        private void UserCommandManager_NewCommand(object sender, UserCommandEventArgs e)
        {
            List <StrategyRunner> list = new List <StrategyRunner>();

            if (e.Command.Strategy == null)
            {
                list.AddRange((IEnumerable <StrategyRunner>) this.strategies.Values);
            }
            else
            {
                StrategyRunner strategyRunner;
                if (this.strategies.TryGetValue(e.Command.Strategy, out strategyRunner))
                {
                    list.Add(strategyRunner);
                }
            }
            foreach (StrategyRunner strategyRunner in list)
            {
                if (strategyRunner.Enabled)
                {
                    strategyRunner.SetUserCommand(e.Command.Command);
                }
            }
        }
Beispiel #2
0
 private void UserCommandManager_NewCommand(object sender, UserCommandEventArgs e)
 {
     List<StrategyRunner> list = new List<StrategyRunner>();
     if (e.Command.Strategy == null)
     {
         list.AddRange((IEnumerable<StrategyRunner>)this.strategies.Values);
     }
     else
     {
         StrategyRunner strategyRunner;
         if (this.strategies.TryGetValue(e.Command.Strategy, out strategyRunner))
             list.Add(strategyRunner);
     }
     foreach (StrategyRunner strategyRunner in list)
     {
         if (strategyRunner.Enabled)
             strategyRunner.SetUserCommand(e.Command.Command);
     }
 }