public NegotiateNewEnviron(EnvironVarCode NameCode, string NameText)
 {
     this.NameCode    = NameCode;
     this.NameText    = NameText;
     this.DoSendValue = false;
     this.ValueText   = null;
 }
Esempio n. 2
0
 public OptionVariable(EnvironVarCode VarCode, string NameText, bool ValueEmpty)
     : this()
 {
     this.VarCode    = VarCode;
     this.NameBytes  = Encoding.ASCII.GetBytes(NameText);
     this.ValueEmpty = ValueEmpty;
 }
Esempio n. 3
0
 public OptionVariable(EnvironVarCode VarCode, string NameText, byte[] Value)
     : this()
 {
     this.VarCode    = VarCode;
     this.NameBytes  = Encoding.ASCII.GetBytes(NameText);
     this.ValueBytes = Value;
 }
Esempio n. 4
0
        public OptionVariable(EnvironVarCode VarCode, byte[] NameBytes, byte[] ValueBytes)
            : this()
        {
            this.VarCode    = VarCode;
            this.NameBytes  = NameBytes;
            this.ValueBytes = ValueBytes;

            ParseNameBytes(this.NameBytes);
        }
Esempio n. 5
0
        public byte[] ToBytes()
        {
            ByteArrayBuilder ab = new ByteArrayBuilder();

            ab.Append(this.VarCode.ToByte());
            ab.Append(this.NameBytes);
            if ((this.ValueBytes != null) && (this.ValueBytes.Length > 0))
            {
                EnvironVarCode optnCode = EnvironVarCode.VALUE;
                ab.Append(optnCode.ToByte());
                ab.Append(this.ValueBytes);
            }
            else if (this.ValueEmpty == true)
            {
                EnvironVarCode optnCode = EnvironVarCode.VALUE;
                ab.Append(optnCode.ToByte());
            }
            return(ab.ToByteArray());
        }
Esempio n. 6
0
        public void AddOptionVar(EnvironVarCode VarCode, string VarName, byte[] VarValue)
        {
            var ov = new OptionVariable(VarCode, VarName, VarValue);

            this.OptionList.Add(ov);
        }
 public BuildOptionVariable(EnvironVarCode NameCode, string NameText)
 {
     this.NameCode = NameCode;
     this.NameText = NameText;
 }
        public static byte ToByte(this EnvironVarCode OptionCode)
        {
            byte b1 = (byte)OptionCode;

            return(b1);
        }