using System.Text; namespace Renci.SshNet.Messages.Connection { /// /// Represents "exec" type channel request information /// internal class ExecRequestInfo : RequestInfo { /// /// Channel request name /// public const string NAME = "exec"; /// /// Gets the name of the request. /// /// /// The name of the request. /// public override string RequestName { get { return ExecRequestInfo.NAME; } } /// /// Gets command to execute. /// public string Command { get; private set; } /// /// Initializes a new instance of the class. /// public ExecRequestInfo() { this.WantReply = true; } /// /// Initializes a new instance of the class. /// /// The command. /// is null. public ExecRequestInfo(string command) : this() { if (command == null) throw new System.ArgumentNullException("command"); this.Command = command; } /// /// Called when type specific data need to be loaded. /// protected override void LoadData() { base.LoadData(); this.Command = this.ReadString(); } /// /// Called when type specific data need to be saved. /// protected override void SaveData() { base.SaveData(); this.Write(this.Command); } } }