public override void EncodeTyped(ref JsonEncoder encoder, T pairs) { encoder.Write("{"); bool first = true; foreach (var kvp in pairs) { if (!first) { encoder.Write(", "); } else { first = false; } encoder.EncodeString(kvp.Key); encoder.Write(": "); this.valueEncoder.EncodeTyped(ref encoder, kvp.Value); } encoder.Write("}"); return; }
public override void EncodeTyped(ref JsonEncoder encoder, TInstance instance) { encoder.EncodeString <string>(member.Name); encoder.Write(": "); this.valueEncoder.EncodeTyped(ref encoder, this.member.GetTypedValue(ref instance)); }
public override void EncodeTyped(ref JsonEncoder encoder, T value) { encoder.EncodeString(value); }