X11ChannelOpenInfo.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. namespace Renci.SshNet.Messages.Connection
  2. {
  3. /// <summary>
  4. /// Used to open "x11" channel type
  5. /// </summary>
  6. internal class X11ChannelOpenInfo : ChannelOpenInfo
  7. {
  8. /// <summary>
  9. /// Specifies channel open type
  10. /// </summary>
  11. public const string NAME = "x11";
  12. /// <summary>
  13. /// Gets the type of the channel to open.
  14. /// </summary>
  15. /// <value>
  16. /// The type of the channel to open.
  17. /// </value>
  18. public override string ChannelType
  19. {
  20. get { return NAME; }
  21. }
  22. /// <summary>
  23. /// Gets the originator address.
  24. /// </summary>
  25. public string OriginatorAddress { get; private set; }
  26. /// <summary>
  27. /// Gets the originator port.
  28. /// </summary>
  29. public uint OriginatorPort { get; private set; }
  30. /// <summary>
  31. /// Called when type specific data need to be loaded.
  32. /// </summary>
  33. protected override void LoadData()
  34. {
  35. base.LoadData();
  36. this.OriginatorAddress = this.ReadString();
  37. this.OriginatorPort = this.ReadUInt32();
  38. }
  39. /// <summary>
  40. /// Called when type specific data need to be saved.
  41. /// </summary>
  42. protected override void SaveData()
  43. {
  44. base.SaveData();
  45. this.Write(this.OriginatorAddress);
  46. this.Write(this.OriginatorPort);
  47. }
  48. }
  49. }