Implements WriteJson.
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)