Json.NET custom serialization/deserialization of a third party type
问题 I want to converts Vectors of the OpenTK library to and from JSON. The way I thought it worked is just making a custom JsonConverter, so I did this: class VectorConverter : JsonConverter { public override bool CanConvert(Type objectType) { return objectType == typeof(Vector4); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var obj = JToken.Load(reader); if (obj.Type == JTokenType.Array) { var arr = (JArray)obj; if (arr