Table of Contents

Class VersionConverter

Namespace
Newtonsoft.Json.Converters
Assembly
Newtonsoft.Json.dll

Converts a Version to and from a string (e.g. "1.2.3.4").

public class VersionConverter : JsonConverter
Inheritance
VersionConverter
Inherited Members

Constructors

VersionConverter()

public VersionConverter()

Methods

CanConvert(Type)

Determines whether this instance can convert the specified object type.

public override bool CanConvert(Type objectType)

Parameters

objectType Type

Type of the object.

Returns

bool

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 override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

Parameters

reader JsonReader

The JsonReader to read from.

objectType Type

Type of the object.

existingValue object

The existing property value of the JSON that is being converted.

serializer JsonSerializer

The calling serializer.

Returns

object

The object value.

WriteJson(JsonWriter, object, JsonSerializer)

Writes the JSON representation of the object.

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

Parameters

writer JsonWriter

The JsonWriter to write to.

value object

The value.

serializer JsonSerializer

The calling serializer.