Exemple #1
0
        public string Serialise(object o)
        {
            var type = o.GetType();

            JsonSerialiser serializer = FindFirstConverter(type);

            if (serializer != null)
            {
                return(serializer.Convert(o));
            }

            return(SerialiseValueType(o));
        }
 public static void Add(Type type, JsonSerialiser converter)
 {
     mConverters.Add(type, converter);
 }
Exemple #3
0
 public void Add(Type type, JsonSerialiser converter)
 {
     mConverters[type] = converter;
 }