GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
NullableTimeSpanYamlConverter Class Reference

Writes a TimeSpan, and a null TimeSpan?, the way the rest of GPAL writes nulls. Without this YamlDotNet has no handling for the type and renders a null as an empty string, which does not read back as a null.
The "c" format is the round-trippable one, matching what ConverterHelper writes elsewhere. More...

Inheritance diagram for NullableTimeSpanYamlConverter:

Public Member Functions

bool Accepts (Type type)
object ReadYaml (IParser parser, Type type)
object ReadYaml (IParser parser, Type type, ObjectDeserializer rootDeserializer)
void WriteYaml (IEmitter emitter, object value, Type type)
void WriteYaml (IEmitter emitter, object value, Type type, ObjectSerializer serializer)

Detailed Description

Writes a TimeSpan, and a null TimeSpan?, the way the rest of GPAL writes nulls. Without this YamlDotNet has no handling for the type and renders a null as an empty string, which does not read back as a null.
The "c" format is the round-trippable one, matching what ConverterHelper writes elsewhere.

Definition at line 28 of file NullableTimeSpanYamlConverter.cs.

Member Function Documentation

◆ Accepts()

bool NullableTimeSpanYamlConverter.Accepts ( Type type)

Definition at line 30 of file NullableTimeSpanYamlConverter.cs.

◆ ReadYaml() [1/2]

object NullableTimeSpanYamlConverter.ReadYaml ( IParser parser,
Type type )

Definition at line 35 of file NullableTimeSpanYamlConverter.cs.

◆ ReadYaml() [2/2]

object NullableTimeSpanYamlConverter.ReadYaml ( IParser parser,
Type type,
ObjectDeserializer rootDeserializer )

Definition at line 45 of file NullableTimeSpanYamlConverter.cs.

◆ WriteYaml() [1/2]

void NullableTimeSpanYamlConverter.WriteYaml ( IEmitter emitter,
object value,
Type type )

Definition at line 55 of file NullableTimeSpanYamlConverter.cs.

◆ WriteYaml() [2/2]

void NullableTimeSpanYamlConverter.WriteYaml ( IEmitter emitter,
object value,
Type type,
ObjectSerializer serializer )

Definition at line 63 of file NullableTimeSpanYamlConverter.cs.


The documentation for this class was generated from the following file: