Interface ICalendarSerializer
- Namespace
- Quartz.Serialization.Newtonsoft.Calendars
- Assembly
- Quartz.Serialization.Newtonsoft.dll
Reads and writes one kind of calendar's own fields, beside the ones every calendar has.
public interface ICalendarSerializer
Remarks
Register an implementation with NewtonsoftJsonSerializerRegistry.AddCalendarSerializer, or
derive from CalendarSerializer<TCalendar> to be handed the calendar already typed.
A calendar with no registered serializer cannot be stored: the first store write fails.
Properties
CalendarTypeName
The serializer-neutral name for the calendar type, matching the discriminator the System.Text.Json package writes for the same calendar. When non-empty, the registry indexes the serializer under this name as well as under the calendar's assembly-qualified type name, so a payload written by either package resolves. The default is empty: the serializer then answers only to the assembly-qualified name, which is what payloads written by 3.x carry.
string CalendarTypeName { get; }
Property Value
Methods
Create(JObject)
Builds the calendar instance the stored fields are then read into.
ICalendar Create(JObject source)
Parameters
sourceJObjectThe stored JSON for one calendar.
Returns
DeserializeFields(ICalendar, JObject)
Reads back what SerializeFields(JsonWriter, ICalendar) wrote, onto the instance Create(JObject) returned.
void DeserializeFields(ICalendar value, JObject source)
Parameters
valueICalendarThe calendar being rebuilt.
sourceJObjectThe stored JSON for that calendar.
SerializeFields(JsonWriter, ICalendar)
Writes this kind of calendar's own fields. The description, time zone and chained base calendar are written around this call rather than by it.
void SerializeFields(JsonWriter writer, ICalendar value)
Parameters
writerJsonWriterThe writer positioned inside the calendar's JSON object.
valueICalendarThe calendar being stored.