ServerEventArgs.cs 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Text;
  2. using Team.Communicate.State;
  3. namespace Team.Communicate.EventArg
  4. {
  5. public class ServerEventArgs : System.EventArgs
  6. {
  7. /// <summary>
  8. /// 提示信息
  9. /// </summary>
  10. public readonly string Message;
  11. /// <summary>
  12. /// 客户端状态封装类
  13. /// </summary>
  14. public TcpClientState State;
  15. /// <summary>
  16. /// 是否已经处理过了
  17. /// </summary>
  18. public bool IsHandled { get; set; }
  19. public ServerEventArgs(string msg)
  20. {
  21. Message = msg;
  22. IsHandled = false;
  23. }
  24. public ServerEventArgs(TcpClientState state)
  25. {
  26. State = state;
  27. IsHandled = false;
  28. Message = Encoding.UTF8.GetString(State.Memory.ToArray());
  29. }
  30. public ServerEventArgs(string msg, TcpClientState state)
  31. {
  32. Message = msg;
  33. State = state;
  34. IsHandled = false;
  35. }
  36. }
  37. }