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
readerJsonReaderThe Newtonsoft.Json.JsonReader to read from.
objectTypeTypeType of the object.
existingValueTUnitTypeThe existing value of object being read. If there is no existing value then
nullwill be used.hasExistingValueboolThe existing value has a value.
serializerJsonSerializerThe 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
writerJsonWriterThe Newtonsoft.Json.JsonWriter to write to.
valueTUnitTypeThe value.
serializerJsonSerializerThe calling serializer.