Esempio n. 1
0
        internal static object BasicDeserialize(string input, int depthLimit, JSerializer serializer)
        {
            JObjectDeserializer jsod = new JObjectDeserializer(input, depthLimit, serializer);
            object result            = jsod.DeserializeInternal(0);

            if (jsod._s.GetNextNonEmptyChar() != null)
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_IllegalPrimitive, jsod._s.ToString()));
            }
            return(result);
        }
Esempio n. 2
0
        internal static object Deserialize(JSerializer serializer, string input, Type type, int depthLimit)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            if (input.Length > serializer.MaxJsonLength)
            {
                throw new ArgumentException(AtlasWeb.JSON_MaxJsonLengthExceeded, "input");
            }

            var o = JObjectDeserializer.BasicDeserialize(input, depthLimit, serializer);

            return(JObjectConverter.ConvertObjectToType(o, type, serializer));
        }