CommandExecutingContext.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using SuperSocket.SocketBase.Protocol;
  6. using SuperSocket.SocketBase.Command;
  7. namespace SuperSocket.SocketBase
  8. {
  9. /// <summary>
  10. /// Command Executing Context
  11. /// </summary>
  12. public class CommandExecutingContext
  13. {
  14. /// <summary>
  15. /// Gets the session.
  16. /// </summary>
  17. public IAppSession Session { get; private set; }
  18. /// <summary>
  19. /// Gets the request info.
  20. /// </summary>
  21. public IRequestInfo RequestInfo { get; private set; }
  22. /// <summary>
  23. /// Gets the current command.
  24. /// </summary>
  25. public ICommand CurrentCommand { get; private set; }
  26. /// <summary>
  27. /// Gets the exception.
  28. /// </summary>
  29. /// <value>
  30. /// The exception.
  31. /// </value>
  32. public Exception Exception { get; internal set; }
  33. /// <summary>
  34. /// Gets a value indicating whether [exception handled].
  35. /// </summary>
  36. /// <value>
  37. /// <c>true</c> if [exception handled]; otherwise, <c>false</c>.
  38. /// </value>
  39. public bool ExceptionHandled { get; internal set; }
  40. /// <summary>
  41. /// Gets or sets a value indicating whether this command executing is cancelled.
  42. /// </summary>
  43. /// <value>
  44. /// <c>true</c> if cancel; otherwise, <c>false</c>.
  45. /// </value>
  46. public bool Cancel { get; set; }
  47. /// <summary>
  48. /// Initializes a new instance of the <see cref="CommandExecutingContext" /> class.
  49. /// </summary>
  50. /// <param name="session">The session.</param>
  51. /// <param name="requestInfo">The request info.</param>
  52. /// <param name="command">The command.</param>
  53. public void Initialize(IAppSession session, IRequestInfo requestInfo, ICommand command)
  54. {
  55. Session = session;
  56. RequestInfo = requestInfo;
  57. CurrentCommand = command;
  58. }
  59. }
  60. }