public MultiDimensionalPricingData(XmlNode xmlNode) { XmlNodeList measureTypeNodeList = xmlNode.SelectNodes("measureType"); if (measureTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in measureTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { measureTypeIDRef = item.Attributes["id"].Name; AssetMeasureType ob = AssetMeasureType(); IDManager.SetID(measureTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { measureTypeIDRef = item.Attributes["href"].Name; } else { measureType = new AssetMeasureType(item); } } } XmlNodeList quoteUnitsNodeList = xmlNode.SelectNodes("quoteUnits"); if (quoteUnitsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quoteUnitsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quoteUnitsIDRef = item.Attributes["id"].Name; PriceQuoteUnits ob = PriceQuoteUnits(); IDManager.SetID(quoteUnitsIDRef, ob); } else if (item.Attributes.ToString() == "href") { quoteUnitsIDRef = item.Attributes["href"].Name; } else { quoteUnits = new PriceQuoteUnits(item); } } } XmlNodeList sideNodeList = xmlNode.SelectNodes("side"); if (sideNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sideNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sideIDRef = item.Attributes["id"].Name; QuotationSideEnum ob = QuotationSideEnum(); IDManager.SetID(sideIDRef, ob); } else if (item.Attributes.ToString() == "href") { sideIDRef = item.Attributes["href"].Name; } else { side = new QuotationSideEnum(item); } } } XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency"); if (currencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(currencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyIDRef = item.Attributes["href"].Name; } else { currency = new Currency(item); } } } XmlNodeList currencyTypeNodeList = xmlNode.SelectNodes("currencyType"); if (currencyTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyTypeIDRef = item.Attributes["id"].Name; ReportingCurrencyType ob = ReportingCurrencyType(); IDManager.SetID(currencyTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyTypeIDRef = item.Attributes["href"].Name; } else { currencyType = new ReportingCurrencyType(item); } } } XmlNodeList timingNodeList = xmlNode.SelectNodes("timing"); if (timingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in timingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { timingIDRef = item.Attributes["id"].Name; QuoteTiming ob = QuoteTiming(); IDManager.SetID(timingIDRef, ob); } else if (item.Attributes.ToString() == "href") { timingIDRef = item.Attributes["href"].Name; } else { timing = new QuoteTiming(item); } } } XmlNodeList businessCenterNodeList = xmlNode.SelectNodes("businessCenter"); if (businessCenterNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in businessCenterNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { businessCenterIDRef = item.Attributes["id"].Name; BusinessCenter ob = BusinessCenter(); IDManager.SetID(businessCenterIDRef, ob); } else if (item.Attributes.ToString() == "href") { businessCenterIDRef = item.Attributes["href"].Name; } else { businessCenter = new BusinessCenter(item); } } } XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId"); if (exchangeIdNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exchangeIdNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exchangeIdIDRef = item.Attributes["id"].Name; ExchangeId ob = ExchangeId(); IDManager.SetID(exchangeIdIDRef, ob); } else if (item.Attributes.ToString() == "href") { exchangeIdIDRef = item.Attributes["href"].Name; } else { exchangeId = new ExchangeId(item); } } } XmlNodeList informationSourceNodeList = xmlNode.SelectNodes("informationSource"); foreach (XmlNode item in informationSourceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { informationSourceIDRef = item.Attributes["id"].Name; List<InformationSource> ob = new List<InformationSource>(); ob.Add(new InformationSource(item)); IDManager.SetID(informationSourceIDRef, ob); } else if (item.Attributes.ToString() == "href") { informationSourceIDRef = item.Attributes["href"].Name; } else { informationSource.Add(new InformationSource(item)); } } } XmlNodeList pricingModelNodeList = xmlNode.SelectNodes("pricingModel"); if (pricingModelNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingModelNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingModelIDRef = item.Attributes["id"].Name; PricingModel ob = PricingModel(); IDManager.SetID(pricingModelIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingModelIDRef = item.Attributes["href"].Name; } else { pricingModel = new PricingModel(item); } } } XmlNodeList timeNodeList = xmlNode.SelectNodes("time"); if (timeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in timeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { timeIDRef = item.Attributes["id"].Name; XsdTypeDateTime ob = XsdTypeDateTime(); IDManager.SetID(timeIDRef, ob); } else if (item.Attributes.ToString() == "href") { timeIDRef = item.Attributes["href"].Name; } else { time = new XsdTypeDateTime(item); } } } XmlNodeList valuationDateNodeList = xmlNode.SelectNodes("valuationDate"); if (valuationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valuationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(valuationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationDateIDRef = item.Attributes["href"].Name; } else { valuationDate = new XsdTypeDate(item); } } } XmlNodeList expiryTimeNodeList = xmlNode.SelectNodes("expiryTime"); if (expiryTimeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in expiryTimeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { expiryTimeIDRef = item.Attributes["id"].Name; XsdTypeDateTime ob = XsdTypeDateTime(); IDManager.SetID(expiryTimeIDRef, ob); } else if (item.Attributes.ToString() == "href") { expiryTimeIDRef = item.Attributes["href"].Name; } else { expiryTime = new XsdTypeDateTime(item); } } } XmlNodeList cashflowTypeNodeList = xmlNode.SelectNodes("cashflowType"); if (cashflowTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cashflowTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashflowTypeIDRef = item.Attributes["id"].Name; CashflowType ob = CashflowType(); IDManager.SetID(cashflowTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashflowTypeIDRef = item.Attributes["href"].Name; } else { cashflowType = new CashflowType(item); } } } XmlNodeList pointNodeList = xmlNode.SelectNodes("point"); foreach (XmlNode item in pointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pointIDRef = item.Attributes["id"].Name; List<PricingStructurePoint> ob = new List<PricingStructurePoint>(); ob.Add(new PricingStructurePoint(item)); IDManager.SetID(pointIDRef, ob); } else if (item.Attributes.ToString() == "href") { pointIDRef = item.Attributes["href"].Name; } else { point.Add(new PricingStructurePoint(item)); } } } }
private static void ParseQuotationSideEnum(string sideAsString, out bool sideSpecified, out QuotationSideEnum side) { sideSpecified = EnumHelper.TryParse(sideAsString, true, out side); if (sideSpecified) { return; } // if side not specified, it must be "Last" if (String.Compare(sideAsString, "Last", StringComparison.OrdinalIgnoreCase) != 0) { throw new ArgumentException("Unknown side: '" + sideAsString + "'"); } }
public SwapCurveValuation(XmlNode xmlNode) { XmlNodeList floatingRateIndexNodeList = xmlNode.SelectNodes("floatingRateIndex"); if (floatingRateIndexNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in floatingRateIndexNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { floatingRateIndexIDRef = item.Attributes["id"].Name; FloatingRateIndex ob = FloatingRateIndex(); IDManager.SetID(floatingRateIndexIDRef, ob); } else if (item.Attributes.ToString() == "href") { floatingRateIndexIDRef = item.Attributes["href"].Name; } else { floatingRateIndex = new FloatingRateIndex(item); } } } XmlNodeList indexTenorNodeList = xmlNode.SelectNodes("indexTenor"); if (indexTenorNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in indexTenorNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { indexTenorIDRef = item.Attributes["id"].Name; Period ob = Period(); IDManager.SetID(indexTenorIDRef, ob); } else if (item.Attributes.ToString() == "href") { indexTenorIDRef = item.Attributes["href"].Name; } else { indexTenor = new Period(item); } } } XmlNodeList spreadNodeList = xmlNode.SelectNodes("spread"); if (spreadNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in spreadNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spreadIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(spreadIDRef, ob); } else if (item.Attributes.ToString() == "href") { spreadIDRef = item.Attributes["href"].Name; } else { spread = new XsdTypeDecimal(item); } } } XmlNodeList sideNodeList = xmlNode.SelectNodes("side"); if (sideNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sideNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sideIDRef = item.Attributes["id"].Name; QuotationSideEnum ob = QuotationSideEnum(); IDManager.SetID(sideIDRef, ob); } else if (item.Attributes.ToString() == "href") { sideIDRef = item.Attributes["href"].Name; } else { side = new QuotationSideEnum(item); } } } }
public PricingStructurePoint(XmlNode xmlNode) { XmlNodeList coordinateNodeList = xmlNode.SelectNodes("coordinate"); if (coordinateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in coordinateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coordinateIDRef = item.Attributes["id"].Name; PricingDataPointCoordinate ob = PricingDataPointCoordinate(); IDManager.SetID(coordinateIDRef, ob); } else if (item.Attributes.ToString() == "href") { coordinateIDRef = item.Attributes["href"].Name; } else { coordinate = new PricingDataPointCoordinate(item); } } } XmlNodeList coordinateReferenceNodeList = xmlNode.SelectNodes("coordinateReference"); if (coordinateReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in coordinateReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coordinateReferenceIDRef = item.Attributes["id"].Name; PricingDataPointCoordinateReference ob = PricingDataPointCoordinateReference(); IDManager.SetID(coordinateReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { coordinateReferenceIDRef = item.Attributes["href"].Name; } else { coordinateReference = new PricingDataPointCoordinateReference(item); } } } XmlNodeList underlyingAssetNodeList = xmlNode.SelectNodes("underlyingAsset"); if (underlyingAssetNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in underlyingAssetNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyingAssetIDRef = item.Attributes["id"].Name; Asset ob = Asset(); IDManager.SetID(underlyingAssetIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyingAssetIDRef = item.Attributes["href"].Name; } else { underlyingAsset = new Asset(item); } } } XmlNodeList basketNodeList = xmlNode.SelectNodes("basket"); if (basketNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in basketNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { basketIDRef = item.Attributes["id"].Name; Basket ob = Basket(); IDManager.SetID(basketIDRef, ob); } else if (item.Attributes.ToString() == "href") { basketIDRef = item.Attributes["href"].Name; } else { basket = new Basket(item); } } } XmlNodeList bondNodeList = xmlNode.SelectNodes("bond"); if (bondNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in bondNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bondIDRef = item.Attributes["id"].Name; Bond ob = Bond(); IDManager.SetID(bondIDRef, ob); } else if (item.Attributes.ToString() == "href") { bondIDRef = item.Attributes["href"].Name; } else { bond = new Bond(item); } } } XmlNodeList cashNodeList = xmlNode.SelectNodes("cash"); if (cashNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cashNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashIDRef = item.Attributes["id"].Name; Cash ob = Cash(); IDManager.SetID(cashIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashIDRef = item.Attributes["href"].Name; } else { cash = new Cash(item); } } } XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity"); if (commodityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in commodityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commodityIDRef = item.Attributes["id"].Name; Commodity ob = Commodity(); IDManager.SetID(commodityIDRef, ob); } else if (item.Attributes.ToString() == "href") { commodityIDRef = item.Attributes["href"].Name; } else { commodity = new Commodity(item); } } } XmlNodeList convertibleBondNodeList = xmlNode.SelectNodes("convertibleBond"); if (convertibleBondNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in convertibleBondNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { convertibleBondIDRef = item.Attributes["id"].Name; ConvertibleBond ob = ConvertibleBond(); IDManager.SetID(convertibleBondIDRef, ob); } else if (item.Attributes.ToString() == "href") { convertibleBondIDRef = item.Attributes["href"].Name; } else { convertibleBond = new ConvertibleBond(item); } } } XmlNodeList equityNodeList = xmlNode.SelectNodes("equity"); if (equityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in equityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityIDRef = item.Attributes["id"].Name; EquityAsset ob = EquityAsset(); IDManager.SetID(equityIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityIDRef = item.Attributes["href"].Name; } else { equity = new EquityAsset(item); } } } XmlNodeList exchangeTradedFundNodeList = xmlNode.SelectNodes("exchangeTradedFund"); if (exchangeTradedFundNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exchangeTradedFundNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exchangeTradedFundIDRef = item.Attributes["id"].Name; ExchangeTradedFund ob = ExchangeTradedFund(); IDManager.SetID(exchangeTradedFundIDRef, ob); } else if (item.Attributes.ToString() == "href") { exchangeTradedFundIDRef = item.Attributes["href"].Name; } else { exchangeTradedFund = new ExchangeTradedFund(item); } } } XmlNodeList futureNodeList = xmlNode.SelectNodes("future"); if (futureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in futureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { futureIDRef = item.Attributes["id"].Name; Future ob = Future(); IDManager.SetID(futureIDRef, ob); } else if (item.Attributes.ToString() == "href") { futureIDRef = item.Attributes["href"].Name; } else { future = new Future(item); } } } XmlNodeList indexNodeList = xmlNode.SelectNodes("index"); if (indexNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in indexNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { indexIDRef = item.Attributes["id"].Name; Index ob = Index(); IDManager.SetID(indexIDRef, ob); } else if (item.Attributes.ToString() == "href") { indexIDRef = item.Attributes["href"].Name; } else { index = new Index(item); } } } XmlNodeList loanNodeList = xmlNode.SelectNodes("loan"); if (loanNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in loanNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { loanIDRef = item.Attributes["id"].Name; Loan ob = Loan(); IDManager.SetID(loanIDRef, ob); } else if (item.Attributes.ToString() == "href") { loanIDRef = item.Attributes["href"].Name; } else { loan = new Loan(item); } } } XmlNodeList mortgageNodeList = xmlNode.SelectNodes("mortgage"); if (mortgageNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in mortgageNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { mortgageIDRef = item.Attributes["id"].Name; Mortgage ob = Mortgage(); IDManager.SetID(mortgageIDRef, ob); } else if (item.Attributes.ToString() == "href") { mortgageIDRef = item.Attributes["href"].Name; } else { mortgage = new Mortgage(item); } } } XmlNodeList mutualFundNodeList = xmlNode.SelectNodes("mutualFund"); if (mutualFundNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in mutualFundNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { mutualFundIDRef = item.Attributes["id"].Name; MutualFund ob = MutualFund(); IDManager.SetID(mutualFundIDRef, ob); } else if (item.Attributes.ToString() == "href") { mutualFundIDRef = item.Attributes["href"].Name; } else { mutualFund = new MutualFund(item); } } } XmlNodeList underlyingAssetReferenceNodeList = xmlNode.SelectNodes("underlyingAssetReference"); if (underlyingAssetReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in underlyingAssetReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyingAssetReferenceIDRef = item.Attributes["id"].Name; AssetReference ob = AssetReference(); IDManager.SetID(underlyingAssetReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyingAssetReferenceIDRef = item.Attributes["href"].Name; } else { underlyingAssetReference = new AssetReference(item); } } } XmlNodeList valueNodeList = xmlNode.SelectNodes("value"); if (valueNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valueNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valueIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(valueIDRef, ob); } else if (item.Attributes.ToString() == "href") { valueIDRef = item.Attributes["href"].Name; } else { value = new XsdTypeDecimal(item); } } } XmlNodeList measureTypeNodeList = xmlNode.SelectNodes("measureType"); if (measureTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in measureTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { measureTypeIDRef = item.Attributes["id"].Name; AssetMeasureType ob = AssetMeasureType(); IDManager.SetID(measureTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { measureTypeIDRef = item.Attributes["href"].Name; } else { measureType = new AssetMeasureType(item); } } } XmlNodeList quoteUnitsNodeList = xmlNode.SelectNodes("quoteUnits"); if (quoteUnitsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quoteUnitsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quoteUnitsIDRef = item.Attributes["id"].Name; PriceQuoteUnits ob = PriceQuoteUnits(); IDManager.SetID(quoteUnitsIDRef, ob); } else if (item.Attributes.ToString() == "href") { quoteUnitsIDRef = item.Attributes["href"].Name; } else { quoteUnits = new PriceQuoteUnits(item); } } } XmlNodeList sideNodeList = xmlNode.SelectNodes("side"); if (sideNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sideNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sideIDRef = item.Attributes["id"].Name; QuotationSideEnum ob = QuotationSideEnum(); IDManager.SetID(sideIDRef, ob); } else if (item.Attributes.ToString() == "href") { sideIDRef = item.Attributes["href"].Name; } else { side = new QuotationSideEnum(item); } } } XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency"); if (currencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(currencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyIDRef = item.Attributes["href"].Name; } else { currency = new Currency(item); } } } XmlNodeList currencyTypeNodeList = xmlNode.SelectNodes("currencyType"); if (currencyTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyTypeIDRef = item.Attributes["id"].Name; ReportingCurrencyType ob = ReportingCurrencyType(); IDManager.SetID(currencyTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyTypeIDRef = item.Attributes["href"].Name; } else { currencyType = new ReportingCurrencyType(item); } } } XmlNodeList timingNodeList = xmlNode.SelectNodes("timing"); if (timingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in timingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { timingIDRef = item.Attributes["id"].Name; QuoteTiming ob = QuoteTiming(); IDManager.SetID(timingIDRef, ob); } else if (item.Attributes.ToString() == "href") { timingIDRef = item.Attributes["href"].Name; } else { timing = new QuoteTiming(item); } } } XmlNodeList businessCenterNodeList = xmlNode.SelectNodes("businessCenter"); if (businessCenterNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in businessCenterNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { businessCenterIDRef = item.Attributes["id"].Name; BusinessCenter ob = BusinessCenter(); IDManager.SetID(businessCenterIDRef, ob); } else if (item.Attributes.ToString() == "href") { businessCenterIDRef = item.Attributes["href"].Name; } else { businessCenter = new BusinessCenter(item); } } } XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId"); if (exchangeIdNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exchangeIdNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exchangeIdIDRef = item.Attributes["id"].Name; ExchangeId ob = ExchangeId(); IDManager.SetID(exchangeIdIDRef, ob); } else if (item.Attributes.ToString() == "href") { exchangeIdIDRef = item.Attributes["href"].Name; } else { exchangeId = new ExchangeId(item); } } } XmlNodeList informationSourceNodeList = xmlNode.SelectNodes("informationSource"); foreach (XmlNode item in informationSourceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { informationSourceIDRef = item.Attributes["id"].Name; List<InformationSource> ob = new List<InformationSource>(); ob.Add(new InformationSource(item)); IDManager.SetID(informationSourceIDRef, ob); } else if (item.Attributes.ToString() == "href") { informationSourceIDRef = item.Attributes["href"].Name; } else { informationSource.Add(new InformationSource(item)); } } } XmlNodeList pricingModelNodeList = xmlNode.SelectNodes("pricingModel"); if (pricingModelNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingModelNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingModelIDRef = item.Attributes["id"].Name; PricingModel ob = PricingModel(); IDManager.SetID(pricingModelIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingModelIDRef = item.Attributes["href"].Name; } else { pricingModel = new PricingModel(item); } } } XmlNodeList timeNodeList = xmlNode.SelectNodes("time"); if (timeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in timeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { timeIDRef = item.Attributes["id"].Name; XsdTypeDateTime ob = XsdTypeDateTime(); IDManager.SetID(timeIDRef, ob); } else if (item.Attributes.ToString() == "href") { timeIDRef = item.Attributes["href"].Name; } else { time = new XsdTypeDateTime(item); } } } XmlNodeList valuationDateNodeList = xmlNode.SelectNodes("valuationDate"); if (valuationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valuationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(valuationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationDateIDRef = item.Attributes["href"].Name; } else { valuationDate = new XsdTypeDate(item); } } } XmlNodeList expiryTimeNodeList = xmlNode.SelectNodes("expiryTime"); if (expiryTimeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in expiryTimeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { expiryTimeIDRef = item.Attributes["id"].Name; XsdTypeDateTime ob = XsdTypeDateTime(); IDManager.SetID(expiryTimeIDRef, ob); } else if (item.Attributes.ToString() == "href") { expiryTimeIDRef = item.Attributes["href"].Name; } else { expiryTime = new XsdTypeDateTime(item); } } } XmlNodeList cashflowTypeNodeList = xmlNode.SelectNodes("cashflowType"); if (cashflowTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cashflowTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashflowTypeIDRef = item.Attributes["id"].Name; CashflowType ob = CashflowType(); IDManager.SetID(cashflowTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashflowTypeIDRef = item.Attributes["href"].Name; } else { cashflowType = new CashflowType(item); } } } }