Exemplo n.º 1
0
        internal static CurrencyIsoCode GetValue(this JToken token, CurrencyStyle style)
        {
            CurrencyIsoCode value;

            switch (style)
            {
            case CurrencyStyle.Alphabetic:
                var alphabetic = token.Value <string>();
                value = Currency.Code.Parse(alphabetic);
                break;

            case CurrencyStyle.Numeric:
                var numeric = token.Value <short>();
                value = Currency.Code.Cast(numeric);
                break;

            default:
                throw new ArgumentOutOfRangeException("style");
            }
            return(value);
        }
Exemplo n.º 2
0
 public DefaultMoneyConverter(CurrencyStyle style)
 {
     _writer = new DefaultMoneyWriter(style);
     _reader = new DefaultMoneyReader(style);
 }
Exemplo n.º 3
0
        internal static void WriteValue(this JsonWriter writer, CurrencyIsoCode currency, CurrencyStyle style)
        {
            switch (style)
            {
            case CurrencyStyle.Alphabetic:
                writer.WriteValue(currency.AlphabeticCode());
                break;

            case CurrencyStyle.Numeric:
                writer.WriteValue(currency.NumericCode());
                break;

            default:
                throw new ArgumentOutOfRangeException("style");
            }
        }
Exemplo n.º 4
0
 public DefaultMoneyWriter(CurrencyStyle style)
 {
     _style = style;
 }
Exemplo n.º 5
0
 public DefaultMoneyReader(CurrencyStyle style)
 {
     _style = style;
 }
Exemplo n.º 6
0
 public DefaultMoneyWriter(Money instance, CurrencyStyle style, IContractResolver resolver)
     : base(resolver)
 {
     _instance = instance;
     _style    = style;
 }
Exemplo n.º 7
0
 public DefaultMoneyReader(CurrencyStyle style, IContractResolver resolver)
     : base(resolver)
 {
     _style = style;
 }
Exemplo n.º 8
0
 public DefaultMoneyConverter(CurrencyStyle style)
 {
     _style = style;
 }
Exemplo n.º 9
0
 public static async void ShowCurrencyIcon(this EntityComponent entityCompoennt, CurrencyStyle currencyStyle, CurrencyType currencyType, Transform parent)
 {
     await GameEntry.Entity.ShowCurrencyIconAsync(currencyStyle, currencyType, parent);
 }
Exemplo n.º 10
0
 public static async Task <CurrencyIcon> ShowCurrencyIconAsync(this EntityComponent entityCompoennt, CurrencyStyle currencyStyle, CurrencyType currencyType, Transform parent)
 {
     return(await GameEntry.Entity.ShowMultiAssetsItemAsync <CurrencyIcon, CurrencyStyle, CurrencyType>(Constant.UIItem.CurrencyIconTypeID, currencyStyle, currencyType, parent));
 }