URSA.Web.Http.HeaderParameter.ParseInternal C# (CSharp) Method

ParseInternal() private static method

private static ParseInternal ( string key, string rest ) : HeaderParameter
key string
rest string
return HeaderParameter
        private static HeaderParameter ParseInternal(string key, string rest)
        {
            HeaderParameter result = new HeaderParameter(key);
            if (rest == null)
            {
                return result;
            }

            if ((rest.Length > 2) && (rest[0] == '"') && (rest[rest.Length - 1] == '"'))
            {
                result.Value = rest.Trim('"').Unescape();
            }
            else if ((rest.Length > 2) && (rest[0] == '<') && (rest[rest.Length - 1] == '>'))
            {
                result.Value = new Uri(rest.Trim('<', '>').Unescape());
            }
            else
            {
                double numericValue;
                result.Value = (Double.TryParse(rest, AllowedNumberStyles, CultureInfo.InvariantCulture, out numericValue) ? 
                    numericValue :
                    AppDomain.CurrentDomain.GetAssemblies().FindEnumValue(rest)) ?? rest;
            }

            return result;
        }
    }