Exemplo n.º 1
0
        public Node(string sJson, Deserializer.Options options = null)
        {
            var node = Deserializer.FromJson(sJson, options);

            _type = node._type;
            Value = node.Value;
        }
Exemplo n.º 2
0
        public static Node FromJson(string sJson, Deserializer.Options options = null)
        {
            var jss = new JavaScriptSerializer();

            if (options != null)
            {
                if (options.RecursionLimit != Options.DefaultRecursionLimit)
                {
                    jss.RecursionLimit = options.RecursionLimit;
                }
                if (options.MaxJsonLength != Options.DefaultMaxJsonLength)
                {
                    jss.MaxJsonLength = options.MaxJsonLength;
                }
            }

            var jsonObject = jss.DeserializeObject(sJson);

            return(Deserializer.NodeFromJsonObject(jsonObject));
        }