Skip to main content

NewtonCrsConverter

Namespace: Meshmakers.Octo.Runtime.Contracts.Geospatial.Converters

Converts ICRSObject types to and from JSON.

public class NewtonCrsConverter : JsonConverter

Inheritance Object → JsonConverter → NewtonCrsConverter

Properties

CanRead

public bool CanRead { get; }

Property Value

Boolean

CanWrite

public bool CanWrite { get; }

Property Value

Boolean

Constructors

NewtonCrsConverter()

public NewtonCrsConverter()

Methods

CanConvert(Type)

Determines whether this instance can convert the specified object type.

public bool CanConvert(Type objectType)

Parameters

objectType Type
Type of the object.

Returns

Boolean
true if this instance can convert the specified object type; otherwise, false.

ReadJson(JsonReader, Type, Object, JsonSerializer)

Reads the JSON representation of the object.

public object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

Parameters

reader JsonReader
The to read from.

objectType Type
Type of the object.

existingValue Object
The existing value of object being read.

serializer JsonSerializer
The calling serializer.

Returns

Object
The object value.

Exceptions

T:Newtonsoft.Json.JsonReaderException
CRS must be null or a json object or CRS must have a "type" property

WriteJson(JsonWriter, Object, JsonSerializer)

Writes the JSON representation of the object.

public void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

Parameters

writer JsonWriter
The to write to.

value Object
The value.

serializer JsonSerializer
The calling serializer.

Exceptions

ArgumentOutOfRangeException