Table of Contents

Class JsonRegexListConverter

Namespace
DuetAPI.Utility
Assembly
DuetAPI.dll

JSON converter to read and write a list of regular expressions

public class JsonRegexListConverter : JsonConverter<List<Regex>>
Inheritance
JsonRegexListConverter
Inherited Members

Remarks

This class may become obsolete in a future .NET Core version. For some reason it has no effect to add this converter to the default JSON options.

Constructors

JsonRegexListConverter()

public JsonRegexListConverter()

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions?)

Read a Regex list from JSON

public override List<Regex> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions? options)

Parameters

reader Utf8JsonReader

JSON reader

typeToConvert Type

Type to convert

options JsonSerializerOptions

Reader options

Returns

List<Regex>

Read value

Write(Utf8JsonWriter, List<Regex>, JsonSerializerOptions?)

Write a Regex list to JSON

public override void Write(Utf8JsonWriter writer, List<Regex> value, JsonSerializerOptions? options)

Parameters

writer Utf8JsonWriter

JSON writer

value List<Regex>

Value to serialize

options JsonSerializerOptions

Write options