XonXoffRequestInfo.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. namespace Renci.SshNet.Messages.Connection
  2. {
  3. /// <summary>
  4. /// Represents "xon-xoff" type channel request information
  5. /// </summary>
  6. internal class XonXoffRequestInfo : RequestInfo
  7. {
  8. /// <summary>
  9. /// Channel request type
  10. /// </summary>
  11. public const string NAME = "xon-xoff";
  12. /// <summary>
  13. /// Gets the name of the request.
  14. /// </summary>
  15. /// <value>
  16. /// The name of the request.
  17. /// </value>
  18. public override string RequestName
  19. {
  20. get { return XonXoffRequestInfo.NAME; }
  21. }
  22. /// <summary>
  23. /// Gets or sets a value indicating whether client can do.
  24. /// </summary>
  25. /// <value>
  26. /// <c>true</c> if client can do; otherwise, <c>false</c>.
  27. /// </value>
  28. public bool ClientCanDo { get; set; }
  29. /// <summary>
  30. /// Initializes a new instance of the <see cref="XonXoffRequestInfo"/> class.
  31. /// </summary>
  32. public XonXoffRequestInfo()
  33. {
  34. this.WantReply = false;
  35. }
  36. /// <summary>
  37. /// Initializes a new instance of the <see cref="XonXoffRequestInfo"/> class.
  38. /// </summary>
  39. /// <param name="clientCanDo">if set to <c>true</c> [client can do].</param>
  40. public XonXoffRequestInfo(bool clientCanDo)
  41. : this()
  42. {
  43. this.ClientCanDo = clientCanDo;
  44. }
  45. /// <summary>
  46. /// Called when type specific data need to be loaded.
  47. /// </summary>
  48. protected override void LoadData()
  49. {
  50. base.LoadData();
  51. this.ClientCanDo = this.ReadBoolean();
  52. }
  53. /// <summary>
  54. /// Called when type specific data need to be saved.
  55. /// </summary>
  56. protected override void SaveData()
  57. {
  58. base.SaveData();
  59. this.Write(this.ClientCanDo);
  60. }
  61. }
  62. }