Exemple #1
0
        public StringWithQualityHeaderValue(string value, double quality)
        {
            HeaderUtilities.CheckValidToken(value, nameof(value));

            if ((quality < 0) || (quality > 1))
            {
                throw new ArgumentOutOfRangeException(nameof(quality));
            }

            _value   = value;
            _quality = quality;
        }
        public ProductHeaderValue(string name, string version)
        {
            HeaderUtilities.CheckValidToken(name, "name");

            if (!string.IsNullOrEmpty(version))
            {
                HeaderUtilities.CheckValidToken(version, "version");
                _version = version;
            }

            _name = name;
        }
        public StringWithQualityHeaderValue(string value, double quality)
        {
            HeaderUtilities.CheckValidToken(value, "value");

            if ((quality < 0) || (quality > 1))
            {
                throw new ArgumentOutOfRangeException("quality");
            }

            this.value   = value;
            this.quality = quality;
        }
Exemple #4
0
        public ProductHeaderValue(string name, string version)
        {
            HeaderUtilities.CheckValidToken(name, "name");

            if (!string.IsNullOrEmpty(version))
            {
                // It's OK to have no version specified. But if, then it must be a valid token.
                HeaderUtilities.CheckValidToken(version, "version");
                this.version = version; // only assign value if it is not empty.
            }

            this.name = name;
        }
Exemple #5
0
        public ViaHeaderValue(string protocolVersion, string receivedBy, string protocolName, string comment)
        {
            HeaderUtilities.CheckValidToken(protocolVersion, "protocolVersion");
            CheckReceivedBy(receivedBy);

            if (!string.IsNullOrEmpty(protocolName))
            {
                HeaderUtilities.CheckValidToken(protocolName, "protocolName");
                _protocolName = protocolName;
            }

            if (!string.IsNullOrEmpty(comment))
            {
                HeaderUtilities.CheckValidComment(comment, "comment");
                _comment = comment;
            }

            _protocolVersion = protocolVersion;
            _receivedBy      = receivedBy;
        }
 private static void CheckIsValidToken(string item)
 {
     HeaderUtilities.CheckValidToken(item, nameof(item));
 }
Exemple #7
0
 public TransferCodingHeaderValue(string value)
 {
     HeaderUtilities.CheckValidToken(value, nameof(value));
     _value = value;
 }
        public StringWithQualityHeaderValue(string value)
        {
            HeaderUtilities.CheckValidToken(value, "value");

            this.value = value;
        }
 public AuthenticationHeaderValue(string scheme, string parameter)
 {
     HeaderUtilities.CheckValidToken(scheme, nameof(scheme));
     _scheme    = scheme;
     _parameter = parameter;
 }
Exemple #10
0
        public StringWithQualityHeaderValue(string value)
        {
            HeaderUtilities.CheckValidToken(value, nameof(value));

            _value = value;
        }
 private static void CheckNameValueFormat(string name, string?value)
 {
     HeaderUtilities.CheckValidToken(name, nameof(name));
     CheckValueFormat(value);
 }
Exemple #12
0
 public AuthenticationHeaderValue(string scheme, string parameter)
 {
     HeaderUtilities.CheckValidToken(scheme, "scheme");
     this.scheme    = scheme;
     this.parameter = parameter;
 }
Exemple #13
0
 public TransferCodingHeaderValue(string value)
 {
     HeaderUtilities.CheckValidToken(value, "value");
     this.value = value;
 }
 public override void Validate(string item) => HeaderUtilities.CheckValidToken(item, nameof(item));
Exemple #15
0
 private static void CheckNameValueFormat(string name, string value)
 {
     HeaderUtilities.CheckValidToken(name, "name");
     NameValueHeaderValue.CheckValueFormat(value);
 }
Exemple #16
0
 private static void ValidateToken(HttpHeaderValueCollection <string> collection, string value)
 {
     HeaderUtilities.CheckValidToken(value, "item");
 }