DurationJsonConverter
Namespace: Shadop.Archmage.Sdk
Newtonsoft.Json converter for Duration serialization and deserialization.
public class DurationJsonConverter : Newtonsoft.Json.JsonConverterInheritance Object → JsonConverter → DurationJsonConverter
Properties
Section titled “Properties”CanRead
Section titled “CanRead”public bool CanRead { get; }Property Value
Section titled “Property Value”CanWrite
Section titled “CanWrite”public bool CanWrite { get; }Property Value
Section titled “Property Value”Constructors
Section titled “Constructors”DurationJsonConverter()
Section titled “DurationJsonConverter()”public DurationJsonConverter()Methods
Section titled “Methods”CanConvert(Type)
Section titled “CanConvert(Type)”public bool CanConvert(Type objectType)Parameters
Section titled “Parameters”objectType Type
Returns
Section titled “Returns”ReadJson(JsonReader, Type, Object, JsonSerializer)
Section titled “ReadJson(JsonReader, Type, Object, JsonSerializer)”Deserializes JSON array or null to Duration (null/empty → Duration.Zero).
public object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)Parameters
Section titled “Parameters”reader JsonReader
objectType Type
existingValue Object
serializer JsonSerializer
Returns
Section titled “Returns”Exceptions
Section titled “Exceptions”T:Newtonsoft.Json.JsonSerializationException
Thrown if JSON format is invalid.
WriteJson(JsonWriter, Object, JsonSerializer)
Section titled “WriteJson(JsonWriter, Object, JsonSerializer)”Serializes Duration to JSON array or null.
public void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)Parameters
Section titled “Parameters”writer JsonWriter
value Object
serializer JsonSerializer