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

Writes a DateTimeOffset as a single round-trippable string, and a null as a null. Without this YamlDotNet walks the struct's properties and emits a mapping of dateTime, utcDateTime, localDateTime, date, day, dayOfWeek and the rest, which carries the same instant six times over and cannot be read back into a DateTimeOffset.
The "o" format is the only one that keeps the offset, which is the whole reason to use this type over DateTime. More...

Inheritance diagram for DateTimeOffsetYamlConverter:

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 DateTimeOffset as a single round-trippable string, and a null as a null. Without this YamlDotNet walks the struct's properties and emits a mapping of dateTime, utcDateTime, localDateTime, date, day, dayOfWeek and the rest, which carries the same instant six times over and cannot be read back into a DateTimeOffset.
The "o" format is the only one that keeps the offset, which is the whole reason to use this type over DateTime.

Definition at line 29 of file DateTimeOffsetYamlConverter.cs.

Member Function Documentation

◆ Accepts()

bool DateTimeOffsetYamlConverter.Accepts ( Type type)

Definition at line 31 of file DateTimeOffsetYamlConverter.cs.

◆ ReadYaml() [1/2]

object DateTimeOffsetYamlConverter.ReadYaml ( IParser parser,
Type type )

Definition at line 36 of file DateTimeOffsetYamlConverter.cs.

◆ ReadYaml() [2/2]

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

Definition at line 46 of file DateTimeOffsetYamlConverter.cs.

◆ WriteYaml() [1/2]

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

Definition at line 56 of file DateTimeOffsetYamlConverter.cs.

◆ WriteYaml() [2/2]

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

Definition at line 64 of file DateTimeOffsetYamlConverter.cs.


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