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); }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { LocalizedWeight obj = (LocalizedWeight)value; writer.WriteValue(obj.ToString()); }