ExceptionTransition.cs 811 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace Wayne.Lib.StateEngine
  3. {
  4. /// <summary>
  5. /// Exception transition is used when State engine issues a transition automatically because Enter() or HandleEvent()
  6. /// throws an exception.
  7. /// </summary>
  8. public class ExceptionTransition : Transition
  9. {
  10. /// <summary>
  11. /// Exception that cause the transition
  12. /// </summary>
  13. public Exception Exception { get; set; }
  14. /// <summary>
  15. /// Constructor
  16. /// </summary>
  17. /// <param name="sender"></param>
  18. /// <param name="type"></param>
  19. /// <param name="exception"></param>
  20. public ExceptionTransition(State sender, object type, Exception exception)
  21. : base(sender, type)
  22. {
  23. Exception = exception;
  24. }
  25. }
  26. }