private void _NextSequence(Action actionOnFail)
        {
            _DisposeSequenceExecutor();

            try {
                if (_state != RunState.Stopping && _sequenceEnumerator.MoveNext())
                {
                    _sequenceExecutor = _sequenceEnumerator.Current;

                    _AssignEventHandlers();

                    _state = RunState.Playing;
                    _sequenceExecutor.Start();
                }
            }
            catch (Exception ex) {
                Logging.ErrorException(ex.Message, ex);
                _DisposeSequenceExecutor();
            }
            finally {
                // Allow an exception to propogate after the caller's failure action
                // has had a chance to execute.
                if (_sequenceExecutor == null)
                {
                    actionOnFail();
                }
            }
        }
 protected override void _OnStart()
 {
     _sequenceExecutor.Start();
 }
Beispiel #3
0
        private void _NextSequence(Action actionOnFail)
        {
            _DisposeSequenceExecutor();

            try {
                if (_state != RunState.Stopping && _sequenceEnumerator.MoveNext()) {
                    _sequenceExecutor = _sequenceEnumerator.Current;

                    _AssignEventHandlers();

                    _state = RunState.Playing;
                    _sequenceExecutor.Start();
                }
            }
            catch (Exception ex) {
                Logging.Error(ex.Message,ex);
                _DisposeSequenceExecutor();
            }
            finally {
                // Allow an exception to propogate after the caller's failure action
                // has had a chance to execute.
                if (_sequenceExecutor == null) {
                    actionOnFail();
                }
            }
        }