Exemplo n.º 1
0
        void IScriptActivityExecutor.ExecuteActivities(ScriptActivityContainer activities)
        {
            foreach (var activity in activities)
            {
                _queuedActivities.Enqueue(activity);
            }

            if (_queuedActivities.Count == 0)
                return;

            _currentActivity = _queuedActivities.Dequeue(); 
        }
Exemplo n.º 2
0
 ProcessState IProcess.Run(long ticksSinceLastRun)
 {
     
     while (true)
     {
         if (_currentActivity.Execute(this) == ScriptActivityRunningState.Completed)
         {
             if (_queuedActivities.Count == 0)
                 return ProcessState.Completed;
             else
                 _currentActivity = _queuedActivities.Dequeue();
         }
         else
         {
             return ProcessState.Running;
         }
     }            
 }