Ejemplo n.º 1
0
 private static Action <T, JsonSerializerHandler> IsLoadDynamic(Type t)
 {
     if (t.IsAnonymousType())
     {
         return((a, b) => SpecialConditions.WriteDynamic(a, b));
     }
     return(null);
 }
Ejemplo n.º 2
0
        internal static void WriteValue(object obj, JsonSerializerHandler handler)
        {
            if (obj == null)
            {
                handler.Writer.Append("null");
                return;
            }
            var type = obj.GetType();

            if (type.IsAnonymousType() || type == typeof(object))
            {
                SpecialConditions.WriteDynamic(obj, handler);
            }
            else
            {
                var jumpAction = SerializerObjectJump.GetThreadSafetyJumpAction(type);
                jumpAction(obj, handler);
            }
        }