/// <summary> /// Reads the JSON representation of the object. /// </summary> /// <param name="reader">The JsonReader to read from.</param> /// <param name="objectType">Type of the object.</param> /// <param name="existingValue">The existing value of object being read.</param> /// <param name="serializer">The calling serializer.</param> public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.ValueType == typeof(string)) { if (objectType == typeof(PlanarDensity)) { return(PlanarDensity.Parse((string)reader.Value)); } } throw new NotImplementedException(); }
public bool Equals(PlanarDensity other) { return(Value == other.Value && !(Unit is null) && Unit.Equals(other.Unit)); }