Class DistanceUnitConverter
Class used to convert distance units to and from JSON
Inherited Members
Namespace: DuetAPI.ObjectModel
Assembly: DuetAPI.dll
Syntax
public class DistanceUnitConverter : JsonConverter<DistanceUnit>
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Read a distance units from a JSON reader
Declaration
public override DistanceUnit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonReader | reader | JSON reader |
Type | typeToConvert | Target type |
JsonSerializerOptions | options | JSON options |
Returns
Type | Description |
---|---|
DistanceUnit | Distance unit value |
Overrides
Write(Utf8JsonWriter, DistanceUnit, JsonSerializerOptions)
Write a distance units to a JSON writer
Declaration
public override void Write(Utf8JsonWriter writer, DistanceUnit value, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | JSON writer |
DistanceUnit | value | Distance unit value |
JsonSerializerOptions | options | JSON options |