public static PriceQuoteUnits Create(PriceQuoteUnitsEnum quoteUnits)
 {
     return(new PriceQuoteUnits
     {
         Value = quoteUnits.ToString()
     });
 }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="commodityType"></param>
        /// <param name="commodityDetails"></param>
        /// <param name="currency"></param>
        /// <param name="multiplier"></param>
        /// <param name="specifiedPrice"></param>
        /// <param name="deliveryDateRollConvention"></param>
        /// <param name="priceQuoteUnits"></param>
        /// <param name="deliveryDates"></param>
        /// <param name="exchangeId"></param>
        /// <param name="informationSource"></param>
        /// <returns></returns>
        public static Commodity Create(string commodityType, string commodityDetails, string currency, int multiplier, SpecifiedPriceEnum specifiedPrice,
                                       Offset deliveryDateRollConvention, PriceQuoteUnitsEnum priceQuoteUnits, DeliveryDatesEnum deliveryDates, string exchangeId, string informationSource)
        {
            var commodity = new Commodity
            {
                currency = new Currency {
                    Value = currency
                },
                commodityBase = new CommodityBase {
                    Value = commodityType
                },
                commodityDetails = new CommodityDetails {
                    Value = commodityDetails
                },
                deliveryDateRollConvention = deliveryDateRollConvention,
                Item1                   = deliveryDates,
                multiplier              = multiplier,
                multiplierSpecified     = true,
                specifiedPriceSpecified = true,
                unit           = new QuantityUnit(),
                specifiedPrice = specifiedPrice
            };

            commodity.unit.Value = priceQuoteUnits.ToString();
            if (exchangeId != null)
            {
                commodity.Item = ExchangeIdHelper.Parse(exchangeId);
            }
            else
            {
                commodity.Item = InformationSourceHelper.Create(informationSource);
            }
            return(commodity);
        }
示例#3
0
 private void AddUnitsMap(int priority, MDSRequestType requestType, string sourcePattern, PriceQuoteUnitsEnum targetUnits)
 {
     _rules.Locked(rules => rules.Add(new MapRule(
                                          MDSDictionaryType.QuoteUnits,
                                          MDSProviderId.GlobalIB, _provider,
                                          requestType,
                                          priority,
                                          sourcePattern, targetUnits.ToString())));
 }
示例#4
0
        public static PriceQuoteUnits Parse(string quoteUnitsAsString)
        {
            PriceQuoteUnitsEnum quoteUnitsEnum = PriceQuoteUnitsEnum.Undefined;

            if (quoteUnitsAsString != null)
            {
                quoteUnitsEnum = PriceQuoteUnitsScheme.ParseEnumString(quoteUnitsAsString);
            }
            return(new PriceQuoteUnits {
                Value = quoteUnitsEnum.ToString()
            });
        }