public abstract WriteJson ( |
||
writer | The |
|
value | object | The value. |
serializer | The calling serializer. | |
return | void |
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) { if (value != null) { writeConverter.WriteJson(writer, baseDate.Add((TimeSpan)value), serializer); } else { writeConverter.WriteJson(writer, value, serializer); } }
private void SerializeValue(JsonWriter writer, object value, JsonConverter memberConverter) { JsonConverter converter; if (value == null) { writer.WriteNull(); } else if (memberConverter != null) { memberConverter.WriteJson(writer, value); } else if (HasClassConverter(value.GetType(), out converter)) { converter.WriteJson(writer, value); } else if (HasMatchingConverter(value.GetType(), out converter)) { converter.WriteJson(writer, value); } else if (JsonConvert.IsJsonPrimitive(value)) { writer.WriteValue(value); } else if (value is IList) { SerializeList(writer, (IList)value); } else if (value is IDictionary) { SerializeDictionary(writer, (IDictionary)value); } else if (value is ICollection) { SerializeCollection(writer, (ICollection)value); } else if (value is IEnumerable) { SerializeEnumerable(writer, (IEnumerable)value); } else if (value is JsonRaw) { writer.WriteRawValue(((JsonRaw)value).Content); } else { SerializeObject(writer, value); } }
private void SerializeValue(JsonWriter writer, object value, JsonConverter memberConverter) { JsonConverter converter; if (value == null) { writer.WriteNull(); } else if (memberConverter != null) { memberConverter.WriteJson(writer, value); } else if (HasClassConverter(value.GetType(), out converter)) { converter.WriteJson(writer, value); } else if (HasMatchingConverter(value.GetType(), out converter)) { converter.WriteJson(writer, value); } else if (JsonConvert.IsJsonPrimitive(value)) { writer.WriteValue(value); } else if (value is IList) { SerializeList(writer, (IList)value); } else if (value is IDictionary) { SerializeDictionary(writer, (IDictionary)value); } else if (value is ICollection) { SerializeCollection(writer, (ICollection)value); } else if (value is IEnumerable) { SerializeEnumerable(writer, (IEnumerable)value); } else if (value is JsonRaw) { writer.WriteRawValue(((JsonRaw)value).Content); } else { SerializeObject(writer, value); } }
private void SerializeConvertable(JsonWriter writer, JsonConverter converter, object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty) { if (this.ShouldWriteReference(value, (JsonProperty) null, contract, collectionContract, containerProperty)) { this.WriteReference(writer, value); } else { if (!this.CheckForCircularReference(writer, value, (JsonProperty) null, contract, collectionContract, containerProperty)) return; this._serializeStack.Add(value); converter.WriteJson(writer, value, (JsonSerializer) this.GetInternalSerializer()); this._serializeStack.RemoveAt(this._serializeStack.Count - 1); } }