Class JsonRegexListConverter
JSON converter to read and write a list of regular expressions
Inherited Members
Namespace: DuetAPI.Utility
Assembly: DuetAPI.dll
Syntax
public class JsonRegexListConverter : JsonConverter<List<Regex>>
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.
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions?)
Read a Regex list from JSON
Declaration
public override List<Regex> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions? options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonReader | reader | JSON reader |
Type | typeToConvert | Type to convert |
JsonSerializerOptions | options | Reader options |
Returns
Type | Description |
---|---|
List<Regex> | Read value |
Overrides
Write(Utf8JsonWriter, List<Regex>, JsonSerializerOptions?)
Write a Regex list to JSON
Declaration
public override void Write(Utf8JsonWriter writer, List<Regex> value, JsonSerializerOptions? options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | JSON writer |
List<Regex> | value | Value to serialize |
JsonSerializerOptions | options | Write options |