Ejemplo n.º 1
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            if (reader.Value == null)
            {
                return(new LocalizedWeight());
            }
            LocalizedWeight obj = new LocalizedWeight(double.Parse((string)reader.Value));

            return(obj);
        }
Ejemplo n.º 2
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            LocalizedWeight obj = (LocalizedWeight)value;

            writer.WriteValue(obj.ToString());
        }