Beispiel #1
0
        /// <summary>
        /// Dispatch
        /// </summary>
        public bool DispatchWithExceptionTrap(IQEvent qEvent, bool ReraiseOnException)
        {
            bool ok;

            qEvent.ApplyActivityId();
            try
            {
                try
                {
                    Dispatch_Internal(qEvent);
                    ok = true;
                }
                catch (Exception ex)
                {
                    ok = false;
                    DoDispatchException(this, ex, this.m_MySourceState, qEvent);
                    if (ReraiseOnException)
                    {
                        throw;
                    }
                }
            }
            finally
            {
                qEvent.ClearActivityId();
            }

            return(ok);
        }
Beispiel #2
0
 /// <summary>
 /// Dispatches the specified event to this state machine
 /// </summary>
 /// <param name="qEvent">The <see cref="IQEvent"/> to dispatch.</param>
 public void Dispatch(IQEvent qEvent)
 {
     qEvent.ApplyActivityId();
     try
     {
         Dispatch_Internal(qEvent);
     }
     finally
     {
         qEvent.ClearActivityId();
     }
 }
Beispiel #3
0
        /// <summary>
        /// Dispatch 
        /// </summary>
        public bool DispatchWithExceptionTrap(IQEvent qEvent, bool ReraiseOnException)
        {
            bool ok;

            qEvent.ApplyActivityId ();
            try
            {
                try
                {
                    Dispatch_Internal (qEvent);
                    ok = true;
                }
                catch (Exception ex)
                {
                    ok = false;
                    DoDispatchException (this, ex, this.m_MySourceStateMethod, qEvent);
                    if (ReraiseOnException)
                    {
                        throw;
                    }
                }
            }
            finally
            {
                qEvent.ClearActivityId ();
            }

            return ok;
        }
Beispiel #4
0
 /// <summary>
 /// Dispatches the specified event to this state machine
 /// </summary>
 /// <param name="qEvent">The <see cref="IQEvent"/> to dispatch.</param>
 public void Dispatch(IQEvent qEvent)
 {
     qEvent.ApplyActivityId ();
     try
     {
         Dispatch_Internal (qEvent);
     }
     finally
     {
         qEvent.ClearActivityId ();
     }
 }