예제 #1
0
 public deserializer(JSONParameters param)
 {
     _params = param;
 }
예제 #2
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));
 }
예제 #3
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));
 }
예제 #4
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));
 }
예제 #5
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));
        }