Beispiel #1
0
 public void Run()
 {
     Canceled = false;
     int CurrN = 0;
     foreach (AbstractAction runningAction in runningActions)
     {
         if (!Canceled)
         {
             CurrN++;
             currAction = runningAction;
             runningAction.Run();
             //окончание
             if (!Canceled)
             {
                 // сообщение об окончании
                 if (OnEndAction != null)
                 {
                     ExecutionActionFinishDelegateArgs args = new ExecutionActionFinishDelegateArgs();
                     args.Last = CurrN >= runningActions.Count;
                     OnEndAction(this, args);
                 }
             }
          }
        }
 }
Beispiel #2
0
 private void newAction_OnExecute(AbstractAction action, ExecuteDelegateArgs args)
 {
     if(OnExecute!=null)
     {
         args.runningAction = action;
         OnExecute(this, args);
     }
 }
Beispiel #3
0
 public void AddAction(AbstractAction newAction)
 {
     runningActions.Add(newAction);
     newAction.OnExecute += newAction_OnExecute;
 }