示例#1
0
        /// <summary>
        /// Gets the currency description.
        /// </summary>
        /// <param name="currencyType">Type of the currency.</param>
        /// <returns>System.String.</returns>
        private static string GetDescription(CurrencyTypeFilter currencyType)
        {
            var type = currencyType.GetType();
            var name = Enum.GetName(type, currencyType);

            if (name != null)
            {
                var field = type.GetField(name);
                if (field != null)
                {
                    var attr =
                        Attribute.GetCustomAttribute(field,
                                                     typeof(DescriptionAttribute)) as DescriptionAttribute;
                    if (attr != null)
                    {
                        return(attr.Description);
                    }
                }
            }
            return(null);
        }
示例#2
0
 /// <summary>
 /// The type of the change currency.
 /// </summary>
 /// <param name="changeCurrencyType">Type of the change currency.</param>
 /// <returns>PaymentBuilder.</returns>
 public PaymentBuilder ChangeCurrencyType(CurrencyTypeFilter changeCurrencyType)
 {
     _changeCurrencyType = changeCurrencyType;
     return(this);
 }
示例#3
0
 /// <summary>
 /// The currency type.
 /// </summary>
 /// <param name="currencyType">Type of the currency.</param>
 /// <returns>PaymentBuilder.</returns>
 public PaymentBuilder CurrencyType(CurrencyTypeFilter currencyType)
 {
     _currencyType = currencyType;
     return(this);
 }