/// <summary>Initializes a new instance of the <see cref="T:NMasters.Silverlight.Net.Http.Headers.ProductInfoHeaderValue" /> class.</summary> public ProductInfoHeaderValue(ProductHeaderValue product) { if (product == null) { throw new ArgumentNullException("product"); } this.product = product; }
/// <summary>Determines whether a string is valid <see cref="T:NMasters.Silverlight.Net.Http.Headers.ProductHeaderValue" /> information.</summary> /// <returns>Returns <see cref="T:System.Boolean" />.true if <paramref name="input" /> is valid <see cref="T:NMasters.Silverlight.Net.Http.Headers.ProductHeaderValue" /> information; otherwise, false.</returns> /// <param name="input">The string to validate.</param> /// <param name="parsedValue">The <see cref="T:NMasters.Silverlight.Net.Http.Headers.ProductHeaderValue" /> version of the string.</param> public static bool TryParse(string input, out ProductHeaderValue parsedValue) { object obj2; int index = 0; parsedValue = null; if (GenericHeaderParser.SingleValueProductParser.TryParseValue(input, null, ref index, out obj2)) { parsedValue = (ProductHeaderValue) obj2; return true; } return false; }
private ProductHeaderValue(ProductHeaderValue source) { this.name = source.name; this.version = source.version; }
internal static int GetProductLength(string input, int startIndex, out ProductHeaderValue parsedValue) { parsedValue = null; if (string.IsNullOrEmpty(input) || (startIndex >= input.Length)) { return 0; } int tokenLength = HttpRuleParser.GetTokenLength(input, startIndex); if (tokenLength == 0) { return 0; } ProductHeaderValue value2 = new ProductHeaderValue { name = input.Substring(startIndex, tokenLength) }; int num2 = startIndex + tokenLength; num2 += HttpRuleParser.GetWhitespaceLength(input, num2); if ((num2 == input.Length) || (input[num2] != '/')) { parsedValue = value2; return (num2 - startIndex); } num2++; num2 += HttpRuleParser.GetWhitespaceLength(input, num2); int length = HttpRuleParser.GetTokenLength(input, num2); if (length == 0) { return 0; } value2.version = input.Substring(num2, length); num2 += length; num2 += HttpRuleParser.GetWhitespaceLength(input, num2); parsedValue = value2; return (num2 - startIndex); }
private ProductInfoHeaderValue(ProductInfoHeaderValue source) { this.product = source.product; this.comment = source.comment; }