Пример #1
0
        private void IterateCommands(CommandIterationHandler iteration)
        {
            if (Commands.Count > 0)
            {
                int current = 0;
                while (current < Commands.Count)
                {
                    Command       command = Commands[current];
                    CommandResult result  = iteration(command);
                    switch (result)
                    {
                    default:
                        current++;
                        break;

                    case CommandResult.Previous:
                        current--;
                        break;
                    }
                }
            }
        }
Пример #2
0
 private void IterateCommands(CommandIterationHandler iteration)
 {
     if (Commands.Count > 0)
     {
         int current = 0;
         while (current < Commands.Count)
         {
             Command command = Commands[current];
             CommandResult result = iteration(command);
             switch (result)
             {
                 default:
                     current++;
                     break;
                 case CommandResult.Previous:
                     current--;
                     break;
             }
         }
     }
 }