示例#1
0
        /// <summary>
        /// Create a formatted json string (beautified) from an object
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static string ToNiceJSON(object obj, JSONParameters param)
        {
            string s = ToJSON(obj, param);

            return(Beautify(s));
        }
示例#2
0
 /// <summary>
 /// Create a typed generic object from the json with parameter override on this call
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="json"></param>
 /// <param name="param"></param>
 /// <returns></returns>
 public static T ToObject <T>(string json, JSONParameters param)
 {
     return(new deserializer(param).ToObject <T>(json));
 }
示例#3
0
 internal JSONSerializer(JSONParameters param)
 {
     _params            = param;
     _useEscapedUnicode = _params.UseEscapedUnicode;
     _MAX_DEPTH         = _params.SerializerMaxDepth;
 }