internal static int GetDispositionTypeLength(string input, int startIndex, out object parsedValue)
 {
     parsedValue = null;
     if (string.IsNullOrEmpty(input) || (startIndex >= input.Length))
     {
         return 0;
     }
     string dispositionType = null;
     int num = GetDispositionTypeExpressionLength(input, startIndex, out dispositionType);
     if (num == 0)
     {
         return 0;
     }
     int num2 = startIndex + num;
     num2 += HttpRuleParser.GetWhitespaceLength(input, num2);
     ContentDispositionHeaderValue value2 = new ContentDispositionHeaderValue {
         dispositionType = dispositionType
     };
     if ((num2 < input.Length) && (input[num2] == ';'))
     {
         num2++;
         int num3 = NameValueHeaderValue.GetNameValueListLength(input, num2, ';', value2.Parameters);
         if (num3 == 0)
         {
             return 0;
         }
         parsedValue = value2;
         return ((num2 + num3) - startIndex);
     }
     parsedValue = value2;
     return (num2 - startIndex);
 }
 //private bool TryDecode5987(string input, out string output)
 //{
 //    output = null;
 //    string[] strArray = input.Split(new char[] { '\'' });
 //    if (strArray.Length != 3)
 //    {
 //        return false;
 //    }
 //    StringBuilder builder = new StringBuilder();
 //    try
 //    {
 //        Encoding encoding = Encoding.GetEncoding(strArray[0]);
 //        string pattern = strArray[2];
 //        byte[] bytes = new byte[pattern.Length];
 //        int count = 0;
 //        for (int i = 0; i < pattern.Length; i++)
 //        {
 //            if (Uri.IsHexEncoding(pattern, i))
 //            {
 //                bytes[count++] = (byte) Uri.HexUnescape(pattern, ref i);
 //                i--;
 //            }
 //            else
 //            {
 //                if (count > 0)
 //                {
 //                    builder.Append(encoding.GetString(bytes, 0, count));
 //                    count = 0;
 //                }
 //                builder.Append(pattern[i]);
 //            }
 //        }
 //        if (count > 0)
 //        {
 //            builder.Append(encoding.GetString(bytes, 0, count));
 //        }
 //    }
 //    catch (ArgumentException)
 //    {
 //        return false;
 //    }
 //    output = builder.ToString();
 //    return true;
 //}
 //private bool TryDecodeMime(string input, out string output)
 //{
 //    output = null;
 //    string str = input;
 //    if (this.IsQuoted(str) && (str.Length >= 10))
 //    {
 //        string[] strArray = str.Split(new char[] { '?' });
 //        if (((strArray.Length != 5) || (strArray[0] != "\"=")) || ((strArray[4] != "=\"") || (strArray[2].ToLowerInvariant() != "b")))
 //        {
 //            return false;
 //        }
 //        try
 //        {
 //            Encoding encoding = Encoding.GetEncoding(strArray[1]);
 //            byte[] bytes = Convert.FromBase64String(strArray[3]);
 //            output = encoding.GetString(bytes);
 //            return true;
 //        }
 //        catch (ArgumentException)
 //        {
 //        }
 //        catch (FormatException)
 //        {
 //        }
 //    }
 //    return false;
 //}
 /// <summary>Determines whether a string is valid <see cref="T:NMasters.Silverlight.Net.Http.Headers.ContentDispositionHeaderValue" /> information.</summary>
 /// <returns>Returns <see cref="T:System.Boolean" />.true if <paramref name="input" /> is valid <see cref="T:NMasters.Silverlight.Net.Http.Headers.ContentDispositionHeaderValue" /> information; otherwise, false.</returns>
 /// <param name="input">The string to validate.</param>
 /// <param name="parsedValue">The <see cref="T:NMasters.Silverlight.Net.Http.Headers.ContentDispositionHeaderValue" /> version of the string.</param>
 public static bool TryParse(string input, out ContentDispositionHeaderValue parsedValue)
 {
     object obj2;
     int index = 0;
     parsedValue = null;
     if (GenericHeaderParser.ContentDispositionParser.TryParseValue(input, null, ref index, out obj2))
     {
         parsedValue = (ContentDispositionHeaderValue) obj2;
         return true;
     }
     return false;
 }