Example #1
0
        /// <summary>
        /// Sends the specified signal to the specified state and (optionally) records the transition
        /// </summary>
        /// <param name="receiverState">The <see cref="QState"/> that represents the state method
        /// to which to send the signal.</param>
        /// <param name="qSignal">The <see cref="QSignals"/> to send.</param>
        /// <param name="recorder">An instance of <see cref="TransitionChainRecorder"/> if the transition
        /// is to be recorded; <see langword="null"/> otherwise.</param>
        /// <returns>The <see cref="QState"/> returned by the state that recieved the signal.</returns>
        /// <remarks>
        /// Even if a recorder is specified, the transition will only be recorded if the state
        /// <see paramref="receiverState"/> actually handled it.
        /// This function is used to record the transition chain for a static transition that is executed
        /// the first time.
        /// </remarks>
        private QState Trigger(QState receiverState, string qSignal, TransitionChainRecorder recorder)
        {
            QState state = Trigger(receiverState, qSignal);

            if ((state == null) && (recorder != null))
            {
                // The receiverState handled the event
                recorder.Record(receiverState, qSignal);
            }
            return(state);
        }
Example #2
0
        /// <summary>
        /// Sends the specified signal to the specified state and (optionally) records the transition
        /// </summary>
        /// <param name="receiverStateMethod">The <see cref="MethodInfo"/> that represents the state method
        /// to which to send the signal.</param>
        /// <param name="qSignal">The <see cref="QSignals"/> to send.</param>
        /// <param name="recorder">An instance of <see cref="TransitionChainRecorder"/> if the transition
        /// is to be recorded; <see langword="null"/> otherwise.</param>
        /// <returns>The <see cref="QState"/> returned by the state that recieved the signal.</returns>
        /// <remarks>
        /// Even if a recorder is specified, the transition will only be recorded if the state
        /// <see paramref="receiverStateMethod"/> actually handled it.
        /// This function is used to record the transition chain for a static transition that is executed
        /// the first time.
        /// </remarks>
        private MethodInfo Trigger(MethodInfo receiverStateMethod, QSignals qSignal, TransitionChainRecorder recorder)
        {
            MethodInfo stateMethod = Trigger(receiverStateMethod, qSignal);

            if ((stateMethod == null) && (recorder != null))
            {
                // The receiverState handled the event
                recorder.Record(receiverStateMethod, qSignal);
            }
            return(stateMethod);
        }
Example #3
0
 private void RecordEntryIntoTargetState(
     QState targetState,
     TransitionChainRecorder recorder)
 {
     recorder.Record(targetState, QSignals.Entry);
 }
Example #4
0
 private void RecordEntryIntoTargetState(
     MethodInfo targetStateMethod,
     TransitionChainRecorder recorder)
 {
     recorder.Record(targetStateMethod, QSignals.Entry);
 }
Example #5
0
 /// <summary>
 /// Sends the specified signal to the specified state and (optionally) records the transition
 /// </summary>
 /// <param name="receiverStateMethod">The <see cref="MethodInfo"/> that represents the state method
 /// to which to send the signal.</param>
 /// <param name="qSignal">The <see cref="QSignals"/> to send.</param>
 /// <param name="recorder">An instance of <see cref="TransitionChainRecorder"/> if the transition
 /// is to be recorded; <see langword="null"/> otherwise.</param>
 /// <returns>The <see cref="QState"/> returned by the state that recieved the signal.</returns>
 /// <remarks>
 /// Even if a recorder is specified, the transition will only be recorded if the state 
 /// <see paramref="receiverStateMethod"/> actually handled it.
 /// This function is used to record the transition chain for a static transition that is executed
 /// the first time. 
 /// </remarks>
 private MethodInfo Trigger(MethodInfo receiverStateMethod, string qSignal, TransitionChainRecorder recorder)
 {
     MethodInfo stateMethod = Trigger(receiverStateMethod, qSignal);
     if ((stateMethod == null) && (recorder != null))
     {
         // The receiverState handled the event
         recorder.Record(receiverStateMethod, qSignal);
     }
     return stateMethod;
 }
Example #6
0
 private void RecordEntryIntoTargetState(
     MethodInfo targetStateMethod,
     TransitionChainRecorder recorder)
 {
     recorder.Record(targetStateMethod, QSignals.Entry);
 }