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; }
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; }
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)); }
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; }
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); }
public AuthenticationHeaderValue(string scheme, string parameter) { HeaderUtilities.CheckValidToken(scheme, "scheme"); this.scheme = scheme; this.parameter = parameter; }
public TransferCodingHeaderValue(string value) { HeaderUtilities.CheckValidToken(value, "value"); this.value = value; }
public override void Validate(string item) => HeaderUtilities.CheckValidToken(item, nameof(item));
private static void CheckNameValueFormat(string name, string value) { HeaderUtilities.CheckValidToken(name, "name"); NameValueHeaderValue.CheckValueFormat(value); }
private static void ValidateToken(HttpHeaderValueCollection <string> collection, string value) { HeaderUtilities.CheckValidToken(value, "item"); }