Table of Contents

Class IntPairJsonConverter

Namespace
VisioForge.Core.MediaBlocks.Serialization
Assembly
VisioForge.Core.dll

Converts an integer pair. Tuple<T1,T2> exposes Item1 and Item2 as read-only properties, which IgnoreReadOnlyProperties drops - without this converter such a value is written as an empty object and restored as 0/0.

public class IntPairJsonConverter : JsonConverter<Tuple<int, int>>

Inheritance

Inherited Members

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type System.Tuple{System.Int32,System.Int32}.

public override Tuple<int, int> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

Tuple<int, int>

The converted value.

Write(Utf8JsonWriter, Tuple<int, int>, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, Tuple<int, int> value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value Tuple<int, int>

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.