CommandFilterAttribute.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using SuperSocket.SocketBase;
  3. using SuperSocket.SocketBase.Command;
  4. namespace SuperSocket.SocketBase.Metadata
  5. {
  6. /// <summary>
  7. /// Command filter attribute
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
  10. public abstract class CommandFilterAttribute : Attribute
  11. {
  12. /// <summary>
  13. /// Gets or sets the execution order.
  14. /// </summary>
  15. /// <value>
  16. /// The order.
  17. /// </value>
  18. public int Order { get; set; }
  19. /// <summary>
  20. /// Called when [command executing].
  21. /// </summary>
  22. /// <param name="commandContext">The command context.</param>
  23. public abstract void OnCommandExecuting(CommandExecutingContext commandContext);
  24. /// <summary>
  25. /// Called when [command executed].
  26. /// </summary>
  27. /// <param name="commandContext">The command context.</param>
  28. public abstract void OnCommandExecuted(CommandExecutingContext commandContext);
  29. }
  30. }