public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            Interface9 interface2 = Class163.smethod_5 <Interface9>(value);
            Type       type       = (interface2.Object_0 != null) ? interface2.Object_0.GetType() : null;

            writer.WriteStartObject();
            writer.WritePropertyName("Key");
            writer.WriteValue(interface2.String_0);
            writer.WritePropertyName("Type");
            writer.WriteValue((type != null) ? type.FullName : null);
            writer.WritePropertyName("Value");
            if (type != null)
            {
                string str;
                if (Class137.smethod_0(interface2.Object_0, type, out str))
                {
                    writer.WriteValue(str);
                }
                else
                {
                    writer.WriteValue(interface2.Object_0);
                }
            }
            else
            {
                writer.WriteNull();
            }
            writer.WriteEndObject();
        }
        private byte[] method_0(object object_0)
        {
            if (object_0.GetType().smethod_14("System.Data.Linq.Binary"))
            {
                return(Class163.smethod_5 <Interface8>(object_0).imethod_0());
            }
            if (!(object_0 is SqlBinary))
            {
                throw new JsonSerializationException("Unexpected value type when writing binary: {0}".smethod_0(CultureInfo.InvariantCulture, object_0.GetType()));
            }
            SqlBinary binary = (SqlBinary)object_0;

            return(binary.Value);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            Interface9 interface2 = Class163.smethod_5 <Interface9>(Activator.CreateInstance(objectType));

            smethod_0(reader, "Key");
            smethod_1(reader);
            interface2.String_0 = reader.Object_0.ToString();
            smethod_0(reader, "Type");
            smethod_1(reader);
            Type type = Type.GetType(reader.Object_0.ToString());

            smethod_0(reader, "Value");
            smethod_1(reader);
            interface2.Object_0 = serializer.Deserialize(reader, type);
            smethod_1(reader);
            return(Class163.smethod_3(interface2));
        }
Beispiel #4
0
        private static Type smethod_13(Type type_1)
        {
            Type attributeType = smethod_14();

            if (attributeType == null)
            {
                return(null);
            }
            object obj2 = type_1.GetCustomAttributes(attributeType, true).SingleOrDefault <object>();

            if (obj2 == null)
            {
                return(null);
            }
            Interface14 interface2 = Boolean_0 ? Class163.smethod_5 <Interface14>(obj2) : new Class141(obj2);

            return(interface2.Type_0);
        }