Table of Contents

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
JsonConverter
JsonConverter<TUnitType>
Toolkit.UnitJsonConverter<TUnitType>
Inherited Members
JsonConverter.CanRead
JsonConverter.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 JsonReader

The Newtonsoft.Json.JsonReader to read from.

objectType Type

Type of the object.

existingValue TUnitType

The existing value of object being read. If there is no existing value then null will be used.

hasExistingValue bool

The existing value has a value.

serializer JsonSerializer

The 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 JsonWriter

The Newtonsoft.Json.JsonWriter to write to.

value TUnitType

The value.

serializer JsonSerializer

The calling serializer.