Class Toolkit.UnitJsonConverter<TUnitType>
- Namespace
- SearchAThing.Sci
- Assembly
- netcore-sci.dll
json converter to write unit using abbrev
public class Toolkit.UnitJsonConverter<TUnitType> : JsonConverter<TUnitType> where TUnitType : Enum
Type Parameters
TUnitType
- json converter to write unit using abbrev
- Inheritance
-
JsonConverterJsonConverter<TUnitType>Toolkit.UnitJsonConverter<TUnitType>
- Inherited Members
-
JsonConverter.CanReadJsonConverter.CanWrite
Methods
ReadJson(JsonReader, Type, TUnitType?, bool, JsonSerializer)
Reads the JSON representation of the object.
public override TUnitType? ReadJson(JsonReader reader, Type objectType, TUnitType? existingValue, bool hasExistingValue, JsonSerializer serializer)
Parameters
reader
JsonReaderThe Newtonsoft.Json.JsonReader to read from.
objectType
TypeType of the object.
existingValue
TUnitTypeThe existing value of object being read. If there is no existing value then
null
will be used.hasExistingValue
boolThe existing value has a value.
serializer
JsonSerializerThe calling serializer.
Returns
- TUnitType
The object value.
WriteJson(JsonWriter, TUnitType?, JsonSerializer)
Writes the JSON representation of the object.
public override void WriteJson(JsonWriter writer, TUnitType? value, JsonSerializer serializer)
Parameters
writer
JsonWriterThe Newtonsoft.Json.JsonWriter to write to.
value
TUnitTypeThe value.
serializer
JsonSerializerThe calling serializer.