Exemplo n.º 1
0
 protected override void writeCurrency(Money instance, IContractResolver resolver, JsonWriter writer)
 {
     writer.WritePropertyName(ElementName.Currency(resolver));
     writer.WriteStartObject();
     writer.WritePropertyName(ElementName.IsoCode(resolver));
     writer.WriteValue(instance.CurrencyCode.AlphabeticCode());
     writer.WriteEndObject();
 }
Exemplo n.º 2
0
 protected override void writeAmount(Money instance, IContractResolver resolver, JsonWriter writer)
 {
     writer.WritePropertyName(ElementName.Amount(resolver));
     writer.WriteValue(instance.Amount);
 }
Exemplo n.º 3
0
 protected override void writeCurrency(Money instance, IContractResolver resolver, JsonWriter writer)
 {
     writer.WritePropertyName(ElementName.Currency(resolver));
     writer.WriteValue(instance.CurrencyCode, _style);
 }
Exemplo n.º 4
0
        public CurrencyIsoCode ReadCurrencyCode(JToken token, IContractResolver resolver)
        {
            JToken isoCode = token[ElementName.Currency(resolver)][ElementName.IsoCode(resolver)];

            return(isoCode.GetValue(CurrencyStyle.Alphabetic));
        }
Exemplo n.º 5
0
 public decimal ReadAmount(JToken token, IContractResolver resolver)
 {
     return(token[ElementName.Amount(resolver)].Value <decimal>());
 }
Exemplo n.º 6
0
        public CurrencyIsoCode ReadCurrencyCode(JToken token, IContractResolver resolver)
        {
            JToken currency = token[ElementName.Currency(resolver)];

            return(currency.GetValue(_style));
        }