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