Example #1
0
 /// <summary>
 /// Create an object of type from the json with parameter override on this call
 /// </summary>
 /// <param name="json"></param>
 /// <param name="type"></param>
 /// <param name="par"></param>
 /// <returns></returns>
 public static object ToObject(string json, Type type, JSONParameters par)
 {
     return(new deserializer(par).ToObject(json, type));
 }
Example #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));
 }
Example #3
0
 /// <summary>
 /// Create an object from the json with parameter override on this call
 /// </summary>
 /// <param name="json"></param>
 /// <param name="param"></param>
 /// <returns></returns>
 public static object ToObject(string json, JSONParameters param)
 {
     return(new deserializer(param).ToObject(json, null));
 }
Example #4
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, param.FormatterIndentSpaces));
        }