public FloatingStrikePrice(XmlNode xmlNode) : base(xmlNode) { XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } }
public FloatingStrikePrice(XmlNode xmlNode) : base(xmlNode) { 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); } } } }
public TradeUnderlyer2(XmlNode xmlNode) { XmlNode floatingRateNode = xmlNode.SelectSingleNode("floatingRate"); if (floatingRateNode != null) { if (floatingRateNode.Attributes["href"] != null || floatingRateNode.Attributes["id"] != null) { if (floatingRateNode.Attributes["id"] != null) { floatingRateIDRef_ = floatingRateNode.Attributes["id"].Value; FloatingRate ob = new FloatingRate(floatingRateNode); IDManager.SetID(floatingRateIDRef_, ob); } else if (floatingRateNode.Attributes["href"] != null) { floatingRateIDRef_ = floatingRateNode.Attributes["href"].Value; } else { floatingRate_ = new FloatingRate(floatingRateNode); } } else { floatingRate_ = new FloatingRate(floatingRateNode); } } XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate"); if (fixedRateNode != null) { if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null) { if (fixedRateNode.Attributes["id"] != null) { fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value; Schedule ob = new Schedule(fixedRateNode); IDManager.SetID(fixedRateIDRef_, ob); } else if (fixedRateNode.Attributes["href"] != null) { fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value; } else { fixedRate_ = new Schedule(fixedRateNode); } } else { fixedRate_ = new Schedule(fixedRateNode); } } XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset"); if (underlyingAssetNode != null) { if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) { if (underlyingAssetNode.Attributes["id"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value; Asset ob = new Asset(underlyingAssetNode); IDManager.SetID(underlyingAssetIDRef_, ob); } else if (underlyingAssetNode.Attributes["href"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value; } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } XmlNode basketNode = xmlNode.SelectSingleNode("basket"); if (basketNode != null) { if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) { if (basketNode.Attributes["id"] != null) { basketIDRef_ = basketNode.Attributes["id"].Value; Basket ob = new Basket(basketNode); IDManager.SetID(basketIDRef_, ob); } else if (basketNode.Attributes["href"] != null) { basketIDRef_ = basketNode.Attributes["href"].Value; } else { basket_ = new Basket(basketNode); } } else { basket_ = new Basket(basketNode); } } XmlNode bondNode = xmlNode.SelectSingleNode("bond"); if (bondNode != null) { if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) { if (bondNode.Attributes["id"] != null) { bondIDRef_ = bondNode.Attributes["id"].Value; Bond ob = new Bond(bondNode); IDManager.SetID(bondIDRef_, ob); } else if (bondNode.Attributes["href"] != null) { bondIDRef_ = bondNode.Attributes["href"].Value; } else { bond_ = new Bond(bondNode); } } else { bond_ = new Bond(bondNode); } } XmlNode cashNode = xmlNode.SelectSingleNode("cash"); if (cashNode != null) { if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) { if (cashNode.Attributes["id"] != null) { cashIDRef_ = cashNode.Attributes["id"].Value; Cash ob = new Cash(cashNode); IDManager.SetID(cashIDRef_, ob); } else if (cashNode.Attributes["href"] != null) { cashIDRef_ = cashNode.Attributes["href"].Value; } else { cash_ = new Cash(cashNode); } } else { cash_ = new Cash(cashNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond"); if (convertibleBondNode != null) { if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) { if (convertibleBondNode.Attributes["id"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value; ConvertibleBond ob = new ConvertibleBond(convertibleBondNode); IDManager.SetID(convertibleBondIDRef_, ob); } else if (convertibleBondNode.Attributes["href"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value; } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } XmlNode equityNode = xmlNode.SelectSingleNode("equity"); if (equityNode != null) { if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) { if (equityNode.Attributes["id"] != null) { equityIDRef_ = equityNode.Attributes["id"].Value; EquityAsset ob = new EquityAsset(equityNode); IDManager.SetID(equityIDRef_, ob); } else if (equityNode.Attributes["href"] != null) { equityIDRef_ = equityNode.Attributes["href"].Value; } else { equity_ = new EquityAsset(equityNode); } } else { equity_ = new EquityAsset(equityNode); } } XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund"); if (exchangeTradedFundNode != null) { if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) { if (exchangeTradedFundNode.Attributes["id"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value; ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode); IDManager.SetID(exchangeTradedFundIDRef_, ob); } else if (exchangeTradedFundNode.Attributes["href"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value; } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } XmlNode futureNode = xmlNode.SelectSingleNode("future"); if (futureNode != null) { if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) { if (futureNode.Attributes["id"] != null) { futureIDRef_ = futureNode.Attributes["id"].Value; Future ob = new Future(futureNode); IDManager.SetID(futureIDRef_, ob); } else if (futureNode.Attributes["href"] != null) { futureIDRef_ = futureNode.Attributes["href"].Value; } else { future_ = new Future(futureNode); } } else { future_ = new Future(futureNode); } } XmlNode indexNode = xmlNode.SelectSingleNode("index"); if (indexNode != null) { if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) { if (indexNode.Attributes["id"] != null) { indexIDRef_ = indexNode.Attributes["id"].Value; Index ob = new Index(indexNode); IDManager.SetID(indexIDRef_, ob); } else if (indexNode.Attributes["href"] != null) { indexIDRef_ = indexNode.Attributes["href"].Value; } else { index_ = new Index(indexNode); } } else { index_ = new Index(indexNode); } } XmlNode loanNode = xmlNode.SelectSingleNode("loan"); if (loanNode != null) { if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) { if (loanNode.Attributes["id"] != null) { loanIDRef_ = loanNode.Attributes["id"].Value; Loan ob = new Loan(loanNode); IDManager.SetID(loanIDRef_, ob); } else if (loanNode.Attributes["href"] != null) { loanIDRef_ = loanNode.Attributes["href"].Value; } else { loan_ = new Loan(loanNode); } } else { loan_ = new Loan(loanNode); } } XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage"); if (mortgageNode != null) { if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) { if (mortgageNode.Attributes["id"] != null) { mortgageIDRef_ = mortgageNode.Attributes["id"].Value; Mortgage ob = new Mortgage(mortgageNode); IDManager.SetID(mortgageIDRef_, ob); } else if (mortgageNode.Attributes["href"] != null) { mortgageIDRef_ = mortgageNode.Attributes["href"].Value; } else { mortgage_ = new Mortgage(mortgageNode); } } else { mortgage_ = new Mortgage(mortgageNode); } } XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund"); if (mutualFundNode != null) { if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) { if (mutualFundNode.Attributes["id"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value; MutualFund ob = new MutualFund(mutualFundNode); IDManager.SetID(mutualFundIDRef_, ob); } else if (mutualFundNode.Attributes["href"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value; } else { mutualFund_ = new MutualFund(mutualFundNode); } } else { mutualFund_ = new MutualFund(mutualFundNode); } } XmlNode quotedCurrencyPairNode = xmlNode.SelectSingleNode("quotedCurrencyPair"); if (quotedCurrencyPairNode != null) { if (quotedCurrencyPairNode.Attributes["href"] != null || quotedCurrencyPairNode.Attributes["id"] != null) { if (quotedCurrencyPairNode.Attributes["id"] != null) { quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["id"].Value; QuotedCurrencyPair ob = new QuotedCurrencyPair(quotedCurrencyPairNode); IDManager.SetID(quotedCurrencyPairIDRef_, ob); } else if (quotedCurrencyPairNode.Attributes["href"] != null) { quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["href"].Value; } else { quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode); } } else { quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode); } } XmlNode referenceEntityNode = xmlNode.SelectSingleNode("referenceEntity"); if (referenceEntityNode != null) { if (referenceEntityNode.Attributes["href"] != null || referenceEntityNode.Attributes["id"] != null) { if (referenceEntityNode.Attributes["id"] != null) { referenceEntityIDRef_ = referenceEntityNode.Attributes["id"].Value; LegalEntity ob = new LegalEntity(referenceEntityNode); IDManager.SetID(referenceEntityIDRef_, ob); } else if (referenceEntityNode.Attributes["href"] != null) { referenceEntityIDRef_ = referenceEntityNode.Attributes["href"].Value; } else { referenceEntity_ = new LegalEntity(referenceEntityNode); } } else { referenceEntity_ = new LegalEntity(referenceEntityNode); } } XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference"); if (payerPartyReferenceNode != null) { if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) { if (payerPartyReferenceNode.Attributes["id"] != null) { payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(payerPartyReferenceNode); IDManager.SetID(payerPartyReferenceIDRef_, ob); } else if (payerPartyReferenceNode.Attributes["href"] != null) { payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value; } else { payerPartyReference_ = new PartyReference(payerPartyReferenceNode); } } else { payerPartyReference_ = new PartyReference(payerPartyReferenceNode); } } XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference"); if (payerAccountReferenceNode != null) { if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) { if (payerAccountReferenceNode.Attributes["id"] != null) { payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(payerAccountReferenceNode); IDManager.SetID(payerAccountReferenceIDRef_, ob); } else if (payerAccountReferenceNode.Attributes["href"] != null) { payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value; } else { payerAccountReference_ = new AccountReference(payerAccountReferenceNode); } } else { payerAccountReference_ = new AccountReference(payerAccountReferenceNode); } } XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference"); if (receiverPartyReferenceNode != null) { if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) { if (receiverPartyReferenceNode.Attributes["id"] != null) { receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(receiverPartyReferenceNode); IDManager.SetID(receiverPartyReferenceIDRef_, ob); } else if (receiverPartyReferenceNode.Attributes["href"] != null) { receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value; } else { receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode); } } else { receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode); } } XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference"); if (receiverAccountReferenceNode != null) { if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) { if (receiverAccountReferenceNode.Attributes["id"] != null) { receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(receiverAccountReferenceNode); IDManager.SetID(receiverAccountReferenceIDRef_, ob); } else if (receiverAccountReferenceNode.Attributes["href"] != null) { receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value; } else { receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode); } } else { receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode); } } }
public InstrumentTradeDetails(XmlNode xmlNode) : base(xmlNode) { XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(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 quantityNodeList = xmlNode.SelectNodes("quantity"); if (quantityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quantityIDRef = item.Attributes["id"].Name; InstrumentTradeQuantity ob = InstrumentTradeQuantity(); IDManager.SetID(quantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { quantityIDRef = item.Attributes["href"].Name; } else { quantity = new InstrumentTradeQuantity(item); } } } XmlNodeList pricingNodeList = xmlNode.SelectNodes("pricing"); if (pricingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingIDRef = item.Attributes["id"].Name; InstrumentTradePricing ob = InstrumentTradePricing(); IDManager.SetID(pricingIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingIDRef = item.Attributes["href"].Name; } else { pricing = new InstrumentTradePricing(item); } } } XmlNodeList principalNodeList = xmlNode.SelectNodes("principal"); if (principalNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in principalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { principalIDRef = item.Attributes["id"].Name; InstrumentTradePrincipal ob = InstrumentTradePrincipal(); IDManager.SetID(principalIDRef, ob); } else if (item.Attributes.ToString() == "href") { principalIDRef = item.Attributes["href"].Name; } else { principal = new InstrumentTradePrincipal(item); } } } }
public AveragePriceLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference"); if (payerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in payerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { payerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(payerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { payerPartyReferenceIDRef = item.Attributes["href"].Name; } else { payerPartyReference = new PartyReference(item); } } } XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference"); if (payerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in payerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { payerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(payerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { payerAccountReferenceIDRef = item.Attributes["href"].Name; } else { payerAccountReference = new AccountReference(item); } } } XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference"); if (receiverPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in receiverPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { receiverPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(receiverPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { receiverPartyReferenceIDRef = item.Attributes["href"].Name; } else { receiverPartyReference = new PartyReference(item); } } } XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference"); if (receiverAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in receiverAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { receiverAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(receiverAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { receiverAccountReferenceIDRef = item.Attributes["href"].Name; } else { receiverAccountReference = new AccountReference(item); } } } XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates"); if (calculationDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationDatesIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationDatesIDRef = item.Attributes["href"].Name; } else { calculationDates = new AdjustableDates(item); } } } XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods"); if (calculationPeriodsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsIDRef = item.Attributes["href"].Name; } else { calculationPeriods = new AdjustableDates(item); } } } XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleIDRef = item.Attributes["id"].Name; CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule(); IDManager.SetID(calculationPeriodsScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleIDRef = item.Attributes["href"].Name; } else { calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(item); } } } XmlNodeList calculationPeriodsReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsReference"); if (calculationPeriodsReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsReference ob = CalculationPeriodsReference(); IDManager.SetID(calculationPeriodsReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsReference = new CalculationPeriodsReference(item); } } } XmlNodeList calculationPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference(); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item); } } } XmlNodeList calculationPeriodsDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsDatesReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsDatesReference ob = CalculationPeriodsDatesReference(); IDManager.SetID(calculationPeriodsDatesReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsDatesReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsDatesReference = new CalculationPeriodsDatesReference(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 quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference"); if (quantityReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quantityReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quantityReferenceIDRef = item.Attributes["id"].Name; QuantityReference ob = QuantityReference(); IDManager.SetID(quantityReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { quantityReferenceIDRef = item.Attributes["href"].Name; } else { quantityReference = new QuantityReference(item); } } } XmlNodeList pricingStartDateNodeList = xmlNode.SelectNodes("pricingStartDate"); if (pricingStartDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingStartDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingStartDateIDRef = item.Attributes["id"].Name; AdjustableDate ob = AdjustableDate(); IDManager.SetID(pricingStartDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingStartDateIDRef = item.Attributes["href"].Name; } else { pricingStartDate = new AdjustableDate(item); } } } XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation"); if (calculationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationIDRef = item.Attributes["id"].Name; FloatingLegCalculation ob = FloatingLegCalculation(); IDManager.SetID(calculationIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationIDRef = item.Attributes["href"].Name; } else { calculation = new FloatingLegCalculation(item); } } } XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates"); if (relativePaymentDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in relativePaymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { relativePaymentDatesIDRef = item.Attributes["id"].Name; CommodityRelativePaymentDates ob = CommodityRelativePaymentDates(); IDManager.SetID(relativePaymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { relativePaymentDatesIDRef = item.Attributes["href"].Name; } else { relativePaymentDates = new CommodityRelativePaymentDates(item); } } } XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates"); if (paymentDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in paymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { paymentDatesIDRef = item.Attributes["id"].Name; AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset(); IDManager.SetID(paymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { paymentDatesIDRef = item.Attributes["href"].Name; } else { paymentDates = new AdjustableDatesOrRelativeDateOffset(item); } } } XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates"); if (masterAgreementPaymentDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in masterAgreementPaymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(masterAgreementPaymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name; } else { masterAgreementPaymentDates = new XsdTypeBoolean(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); } } } }
public FloatingPriceLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates"); if (calculationDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationDatesIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationDatesIDRef = item.Attributes["href"].Name; } else { calculationDates = new AdjustableDates(item); } } } XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods"); if (calculationPeriodsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsIDRef = item.Attributes["href"].Name; } else { calculationPeriods = new AdjustableDates(item); } } } XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleIDRef = item.Attributes["id"].Name; CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule(); IDManager.SetID(calculationPeriodsScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleIDRef = item.Attributes["href"].Name; } else { calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(item); } } } XmlNodeList calculationPeriodsReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsReference"); if (calculationPeriodsReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsReference ob = CalculationPeriodsReference(); IDManager.SetID(calculationPeriodsReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsReference = new CalculationPeriodsReference(item); } } } XmlNodeList calculationPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference(); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item); } } } XmlNodeList calculationPeriodsDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsDatesReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsDatesReference ob = CalculationPeriodsDatesReference(); IDManager.SetID(calculationPeriodsDatesReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsDatesReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsDatesReference = new CalculationPeriodsDatesReference(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 notionalQuantityScheduleNodeList = xmlNode.SelectNodes("notionalQuantitySchedule"); if (notionalQuantityScheduleNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalQuantityScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalQuantityScheduleIDRef = item.Attributes["id"].Name; CommodityNotionalQuantitySchedule ob = CommodityNotionalQuantitySchedule(); IDManager.SetID(notionalQuantityScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalQuantityScheduleIDRef = item.Attributes["href"].Name; } else { notionalQuantitySchedule = new CommodityNotionalQuantitySchedule(item); } } } XmlNodeList notionalQuantityNodeList = xmlNode.SelectNodes("notionalQuantity"); if (notionalQuantityNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalQuantityIDRef = item.Attributes["id"].Name; CommodityNotionalQuantity ob = CommodityNotionalQuantity(); IDManager.SetID(notionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalQuantityIDRef = item.Attributes["href"].Name; } else { notionalQuantity = new CommodityNotionalQuantity(item); } } } XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity"); foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementPeriodsNotionalQuantityIDRef = item.Attributes["id"].Name; List <CommoditySettlementPeriodsNotionalQuantity> ob = new List <CommoditySettlementPeriodsNotionalQuantity>(); ob.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); IDManager.SetID(settlementPeriodsNotionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementPeriodsNotionalQuantityIDRef = item.Attributes["href"].Name; } else { settlementPeriodsNotionalQuantity.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } } XmlNodeList totalNotionalQuantityNodeList = xmlNode.SelectNodes("totalNotionalQuantity"); if (totalNotionalQuantityNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in totalNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { totalNotionalQuantityIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(totalNotionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { totalNotionalQuantityIDRef = item.Attributes["href"].Name; } else { totalNotionalQuantity = new XsdTypeDecimal(item); } } } XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference"); if (quantityReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in quantityReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quantityReferenceIDRef = item.Attributes["id"].Name; QuantityReference ob = QuantityReference(); IDManager.SetID(quantityReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { quantityReferenceIDRef = item.Attributes["href"].Name; } else { quantityReference = new QuantityReference(item); } } } XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation"); if (calculationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationIDRef = item.Attributes["id"].Name; FloatingLegCalculation ob = FloatingLegCalculation(); IDManager.SetID(calculationIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationIDRef = item.Attributes["href"].Name; } else { calculation = new FloatingLegCalculation(item); } } } XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates"); if (relativePaymentDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in relativePaymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { relativePaymentDatesIDRef = item.Attributes["id"].Name; CommodityRelativePaymentDates ob = CommodityRelativePaymentDates(); IDManager.SetID(relativePaymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { relativePaymentDatesIDRef = item.Attributes["href"].Name; } else { relativePaymentDates = new CommodityRelativePaymentDates(item); } } } XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates"); if (paymentDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in paymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { paymentDatesIDRef = item.Attributes["id"].Name; AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset(); IDManager.SetID(paymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { paymentDatesIDRef = item.Attributes["href"].Name; } else { paymentDates = new AdjustableDatesOrRelativeDateOffset(item); } } } XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates"); if (masterAgreementPaymentDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in masterAgreementPaymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(masterAgreementPaymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name; } else { masterAgreementPaymentDates = new XsdTypeBoolean(item); } } } XmlNodeList flatRateNodeList = xmlNode.SelectNodes("flatRate"); if (flatRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in flatRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { flatRateIDRef = item.Attributes["id"].Name; FlatRateEnum ob = FlatRateEnum(); IDManager.SetID(flatRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { flatRateIDRef = item.Attributes["href"].Name; } else { flatRate = new FlatRateEnum(item); } } } XmlNodeList flatRateAmountNodeList = xmlNode.SelectNodes("flatRateAmount"); if (flatRateAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in flatRateAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { flatRateAmountIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(flatRateAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { flatRateAmountIDRef = item.Attributes["href"].Name; } else { flatRateAmount = new NonNegativeMoney(item); } } } }
public AveragePriceLeg(XmlNode xmlNode) : base(xmlNode) { XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference"); if (payerPartyReferenceNode != null) { if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) { if (payerPartyReferenceNode.Attributes["id"] != null) { payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(payerPartyReferenceNode); IDManager.SetID(payerPartyReferenceIDRef_, ob); } else if (payerPartyReferenceNode.Attributes["href"] != null) { payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value; } else { payerPartyReference_ = new PartyReference(payerPartyReferenceNode); } } else { payerPartyReference_ = new PartyReference(payerPartyReferenceNode); } } XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference"); if (payerAccountReferenceNode != null) { if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) { if (payerAccountReferenceNode.Attributes["id"] != null) { payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(payerAccountReferenceNode); IDManager.SetID(payerAccountReferenceIDRef_, ob); } else if (payerAccountReferenceNode.Attributes["href"] != null) { payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value; } else { payerAccountReference_ = new AccountReference(payerAccountReferenceNode); } } else { payerAccountReference_ = new AccountReference(payerAccountReferenceNode); } } XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference"); if (receiverPartyReferenceNode != null) { if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) { if (receiverPartyReferenceNode.Attributes["id"] != null) { receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(receiverPartyReferenceNode); IDManager.SetID(receiverPartyReferenceIDRef_, ob); } else if (receiverPartyReferenceNode.Attributes["href"] != null) { receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value; } else { receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode); } } else { receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode); } } XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference"); if (receiverAccountReferenceNode != null) { if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) { if (receiverAccountReferenceNode.Attributes["id"] != null) { receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(receiverAccountReferenceNode); IDManager.SetID(receiverAccountReferenceIDRef_, ob); } else if (receiverAccountReferenceNode.Attributes["href"] != null) { receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value; } else { receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode); } } else { receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode); } } XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates"); if (calculationDatesNode != null) { if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null) { if (calculationDatesNode.Attributes["id"] != null) { calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value; AdjustableDates ob = new AdjustableDates(calculationDatesNode); IDManager.SetID(calculationDatesIDRef_, ob); } else if (calculationDatesNode.Attributes["href"] != null) { calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value; } else { calculationDates_ = new AdjustableDates(calculationDatesNode); } } else { calculationDates_ = new AdjustableDates(calculationDatesNode); } } XmlNode calculationPeriodsNode = xmlNode.SelectSingleNode("calculationPeriods"); if (calculationPeriodsNode != null) { if (calculationPeriodsNode.Attributes["href"] != null || calculationPeriodsNode.Attributes["id"] != null) { if (calculationPeriodsNode.Attributes["id"] != null) { calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["id"].Value; AdjustableDates ob = new AdjustableDates(calculationPeriodsNode); IDManager.SetID(calculationPeriodsIDRef_, ob); } else if (calculationPeriodsNode.Attributes["href"] != null) { calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["href"].Value; } else { calculationPeriods_ = new AdjustableDates(calculationPeriodsNode); } } else { calculationPeriods_ = new AdjustableDates(calculationPeriodsNode); } } XmlNode calculationPeriodsScheduleNode = xmlNode.SelectSingleNode("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNode != null) { if (calculationPeriodsScheduleNode.Attributes["href"] != null || calculationPeriodsScheduleNode.Attributes["id"] != null) { if (calculationPeriodsScheduleNode.Attributes["id"] != null) { calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["id"].Value; CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); IDManager.SetID(calculationPeriodsScheduleIDRef_, ob); } else if (calculationPeriodsScheduleNode.Attributes["href"] != null) { calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["href"].Value; } else { calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); } } else { calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); } } XmlNode calculationPeriodsReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsReference"); if (calculationPeriodsReferenceNode != null) { if (calculationPeriodsReferenceNode.Attributes["href"] != null || calculationPeriodsReferenceNode.Attributes["id"] != null) { if (calculationPeriodsReferenceNode.Attributes["id"] != null) { calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["id"].Value; CalculationPeriodsReference ob = new CalculationPeriodsReference(calculationPeriodsReferenceNode); IDManager.SetID(calculationPeriodsReferenceIDRef_, ob); } else if (calculationPeriodsReferenceNode.Attributes["href"] != null) { calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["href"].Value; } else { calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode); } } else { calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode); } } XmlNode calculationPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNode != null) { if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null || calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) { if (calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["id"].Value; CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef_, ob); } else if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null) { calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["href"].Value; } else { calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); } } else { calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); } } XmlNode calculationPeriodsDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNode != null) { if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null || calculationPeriodsDatesReferenceNode.Attributes["id"] != null) { if (calculationPeriodsDatesReferenceNode.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["id"].Value; CalculationPeriodsDatesReference ob = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); IDManager.SetID(calculationPeriodsDatesReferenceIDRef_, ob); } else if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null) { calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["href"].Value; } else { calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); } } else { calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode quantityReferenceNode = xmlNode.SelectSingleNode("quantityReference"); if (quantityReferenceNode != null) { if (quantityReferenceNode.Attributes["href"] != null || quantityReferenceNode.Attributes["id"] != null) { if (quantityReferenceNode.Attributes["id"] != null) { quantityReferenceIDRef_ = quantityReferenceNode.Attributes["id"].Value; QuantityReference ob = new QuantityReference(quantityReferenceNode); IDManager.SetID(quantityReferenceIDRef_, ob); } else if (quantityReferenceNode.Attributes["href"] != null) { quantityReferenceIDRef_ = quantityReferenceNode.Attributes["href"].Value; } else { quantityReference_ = new QuantityReference(quantityReferenceNode); } } else { quantityReference_ = new QuantityReference(quantityReferenceNode); } } XmlNode pricingStartDateNode = xmlNode.SelectSingleNode("pricingStartDate"); if (pricingStartDateNode != null) { if (pricingStartDateNode.Attributes["href"] != null || pricingStartDateNode.Attributes["id"] != null) { if (pricingStartDateNode.Attributes["id"] != null) { pricingStartDateIDRef_ = pricingStartDateNode.Attributes["id"].Value; AdjustableDate ob = new AdjustableDate(pricingStartDateNode); IDManager.SetID(pricingStartDateIDRef_, ob); } else if (pricingStartDateNode.Attributes["href"] != null) { pricingStartDateIDRef_ = pricingStartDateNode.Attributes["href"].Value; } else { pricingStartDate_ = new AdjustableDate(pricingStartDateNode); } } else { pricingStartDate_ = new AdjustableDate(pricingStartDateNode); } } XmlNode calculationNode = xmlNode.SelectSingleNode("calculation"); if (calculationNode != null) { if (calculationNode.Attributes["href"] != null || calculationNode.Attributes["id"] != null) { if (calculationNode.Attributes["id"] != null) { calculationIDRef_ = calculationNode.Attributes["id"].Value; FloatingLegCalculation ob = new FloatingLegCalculation(calculationNode); IDManager.SetID(calculationIDRef_, ob); } else if (calculationNode.Attributes["href"] != null) { calculationIDRef_ = calculationNode.Attributes["href"].Value; } else { calculation_ = new FloatingLegCalculation(calculationNode); } } else { calculation_ = new FloatingLegCalculation(calculationNode); } } XmlNode relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates"); if (relativePaymentDatesNode != null) { if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null) { if (relativePaymentDatesNode.Attributes["id"] != null) { relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value; CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode); IDManager.SetID(relativePaymentDatesIDRef_, ob); } else if (relativePaymentDatesNode.Attributes["href"] != null) { relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value; } else { relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode); } } else { relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode); } } XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates"); if (paymentDatesNode != null) { if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null) { if (paymentDatesNode.Attributes["id"] != null) { paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value; AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode); IDManager.SetID(paymentDatesIDRef_, ob); } else if (paymentDatesNode.Attributes["href"] != null) { paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value; } else { paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode); } } else { paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode); } } XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates"); if (masterAgreementPaymentDatesNode != null) { if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null) { if (masterAgreementPaymentDatesNode.Attributes["id"] != null) { masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode); IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob); } else if (masterAgreementPaymentDatesNode.Attributes["href"] != null) { masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value; } else { masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode); } } else { masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode); } } }
public CommodityOption(XmlNode xmlNode) : base(xmlNode) { XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; PutCallEnum ob = PutCallEnum(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new PutCallEnum(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 effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate"); if (effectiveDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in effectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { effectiveDateIDRef = item.Attributes["id"].Name; AdjustableOrRelativeDate ob = AdjustableOrRelativeDate(); IDManager.SetID(effectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { effectiveDateIDRef = item.Attributes["href"].Name; } else { effectiveDate = new AdjustableOrRelativeDate(item); } } } XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate"); if (terminationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in terminationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { terminationDateIDRef = item.Attributes["id"].Name; AdjustableOrRelativeDate ob = AdjustableOrRelativeDate(); IDManager.SetID(terminationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { terminationDateIDRef = item.Attributes["href"].Name; } else { terminationDate = new AdjustableOrRelativeDate(item); } } } XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleIDRef = item.Attributes["id"].Name; CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule(); IDManager.SetID(calculationPeriodsScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleIDRef = item.Attributes["href"].Name; } else { calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(item); } } } XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods"); if (calculationPeriodsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsIDRef = item.Attributes["href"].Name; } else { calculationPeriods = new AdjustableDates(item); } } } XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates"); if (pricingDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingDatesIDRef = item.Attributes["id"].Name; CommodityPricingDates ob = CommodityPricingDates(); IDManager.SetID(pricingDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingDatesIDRef = item.Attributes["href"].Name; } else { pricingDates = new CommodityPricingDates(item); } } } XmlNodeList averagingMethodNodeList = xmlNode.SelectNodes("averagingMethod"); if (averagingMethodNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in averagingMethodNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingMethodIDRef = item.Attributes["id"].Name; AveragingMethodEnum ob = AveragingMethodEnum(); IDManager.SetID(averagingMethodIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingMethodIDRef = item.Attributes["href"].Name; } else { averagingMethod = new AveragingMethodEnum(item); } } } XmlNodeList notionalQuantityScheduleNodeList = xmlNode.SelectNodes("notionalQuantitySchedule"); if (notionalQuantityScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalQuantityScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalQuantityScheduleIDRef = item.Attributes["id"].Name; CommodityNotionalQuantitySchedule ob = CommodityNotionalQuantitySchedule(); IDManager.SetID(notionalQuantityScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalQuantityScheduleIDRef = item.Attributes["href"].Name; } else { notionalQuantitySchedule = new CommodityNotionalQuantitySchedule(item); } } } XmlNodeList notionalQuantityNodeList = xmlNode.SelectNodes("notionalQuantity"); if (notionalQuantityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalQuantityIDRef = item.Attributes["id"].Name; CommodityNotionalQuantity ob = CommodityNotionalQuantity(); IDManager.SetID(notionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalQuantityIDRef = item.Attributes["href"].Name; } else { notionalQuantity = new CommodityNotionalQuantity(item); } } } XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity"); foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementPeriodsNotionalQuantityIDRef = item.Attributes["id"].Name; List<CommoditySettlementPeriodsNotionalQuantity> ob = new List<CommoditySettlementPeriodsNotionalQuantity>(); ob.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); IDManager.SetID(settlementPeriodsNotionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementPeriodsNotionalQuantityIDRef = item.Attributes["href"].Name; } else { settlementPeriodsNotionalQuantity.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } } XmlNodeList totalNotionalQuantityNodeList = xmlNode.SelectNodes("totalNotionalQuantity"); if (totalNotionalQuantityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in totalNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { totalNotionalQuantityIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(totalNotionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { totalNotionalQuantityIDRef = item.Attributes["href"].Name; } else { totalNotionalQuantity = new XsdTypeDecimal(item); } } } XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference"); if (quantityReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quantityReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quantityReferenceIDRef = item.Attributes["id"].Name; QuantityReference ob = QuantityReference(); IDManager.SetID(quantityReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { quantityReferenceIDRef = item.Attributes["href"].Name; } else { quantityReference = new QuantityReference(item); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; CommodityExercise ob = CommodityExercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new CommodityExercise(item); } } } XmlNodeList strikePricePerUnitNodeList = xmlNode.SelectNodes("strikePricePerUnit"); if (strikePricePerUnitNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strikePricePerUnitNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikePricePerUnitIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(strikePricePerUnitIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikePricePerUnitIDRef = item.Attributes["href"].Name; } else { strikePricePerUnit = new NonNegativeMoney(item); } } } XmlNodeList strikePricePerUnitScheduleNodeList = xmlNode.SelectNodes("strikePricePerUnitSchedule"); if (strikePricePerUnitScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strikePricePerUnitScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikePricePerUnitScheduleIDRef = item.Attributes["id"].Name; CommodityStrikeSchedule ob = CommodityStrikeSchedule(); IDManager.SetID(strikePricePerUnitScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikePricePerUnitScheduleIDRef = item.Attributes["href"].Name; } else { strikePricePerUnitSchedule = new CommodityStrikeSchedule(item); } } } XmlNodeList floatingStrikePricePerUnitNodeList = xmlNode.SelectNodes("floatingStrikePricePerUnit"); if (floatingStrikePricePerUnitNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in floatingStrikePricePerUnitNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { floatingStrikePricePerUnitIDRef = item.Attributes["id"].Name; FloatingStrikePrice ob = FloatingStrikePrice(); IDManager.SetID(floatingStrikePricePerUnitIDRef, ob); } else if (item.Attributes.ToString() == "href") { floatingStrikePricePerUnitIDRef = item.Attributes["href"].Name; } else { floatingStrikePricePerUnit = new FloatingStrikePrice(item); } } } XmlNodeList floatingStrikePricePerUnitScheduleNodeList = xmlNode.SelectNodes("floatingStrikePricePerUnitSchedule"); if (floatingStrikePricePerUnitScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in floatingStrikePricePerUnitScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { floatingStrikePricePerUnitScheduleIDRef = item.Attributes["id"].Name; CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule(); IDManager.SetID(floatingStrikePricePerUnitScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { floatingStrikePricePerUnitScheduleIDRef = item.Attributes["href"].Name; } else { floatingStrikePricePerUnitSchedule = new CommodityCalculationPeriodsSchedule(item); } } } XmlNodeList commoditySwapNodeList = xmlNode.SelectNodes("commoditySwap"); if (commoditySwapNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in commoditySwapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commoditySwapIDRef = item.Attributes["id"].Name; CommoditySwap ob = CommoditySwap(); IDManager.SetID(commoditySwapIDRef, ob); } else if (item.Attributes.ToString() == "href") { commoditySwapIDRef = item.Attributes["href"].Name; } else { commoditySwap = new CommoditySwap(item); } } } XmlNodeList commodityForwardNodeList = xmlNode.SelectNodes("commodityForward"); if (commodityForwardNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in commodityForwardNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commodityForwardIDRef = item.Attributes["id"].Name; CommodityForward ob = CommodityForward(); IDManager.SetID(commodityForwardIDRef, ob); } else if (item.Attributes.ToString() == "href") { commodityForwardIDRef = item.Attributes["href"].Name; } else { commodityForward = new CommodityForward(item); } } } XmlNodeList physicalExerciseNodeList = xmlNode.SelectNodes("physicalExercise"); if (physicalExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in physicalExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalExerciseIDRef = item.Attributes["id"].Name; CommodityPhysicalExercise ob = CommodityPhysicalExercise(); IDManager.SetID(physicalExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalExerciseIDRef = item.Attributes["href"].Name; } else { physicalExercise = new CommodityPhysicalExercise(item); } } } XmlNodeList weatherCalculationPeriodsNodeList = xmlNode.SelectNodes("weatherCalculationPeriods"); if (weatherCalculationPeriodsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in weatherCalculationPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { weatherCalculationPeriodsIDRef = item.Attributes["id"].Name; WeatherCalculationPeriods ob = WeatherCalculationPeriods(); IDManager.SetID(weatherCalculationPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { weatherCalculationPeriodsIDRef = item.Attributes["href"].Name; } else { weatherCalculationPeriods = new WeatherCalculationPeriods(item); } } } XmlNodeList weatherCalculationPeriodsReferenceNodeList = xmlNode.SelectNodes("weatherCalculationPeriodsReference"); if (weatherCalculationPeriodsReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in weatherCalculationPeriodsReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { weatherCalculationPeriodsReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsReference ob = CalculationPeriodsReference(); IDManager.SetID(weatherCalculationPeriodsReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { weatherCalculationPeriodsReferenceIDRef = item.Attributes["href"].Name; } else { weatherCalculationPeriodsReference = new CalculationPeriodsReference(item); } } } XmlNodeList weatherNotionalAmountNodeList = xmlNode.SelectNodes("weatherNotionalAmount"); if (weatherNotionalAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in weatherNotionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { weatherNotionalAmountIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(weatherNotionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { weatherNotionalAmountIDRef = item.Attributes["href"].Name; } else { weatherNotionalAmount = new NonNegativeMoney(item); } } } XmlNodeList weatherIndexStrikeLevelNodeList = xmlNode.SelectNodes("weatherIndexStrikeLevel"); if (weatherIndexStrikeLevelNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in weatherIndexStrikeLevelNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { weatherIndexStrikeLevelIDRef = item.Attributes["id"].Name; WeatherIndex ob = WeatherIndex(); IDManager.SetID(weatherIndexStrikeLevelIDRef, ob); } else if (item.Attributes.ToString() == "href") { weatherIndexStrikeLevelIDRef = item.Attributes["href"].Name; } else { weatherIndexStrikeLevel = new WeatherIndex(item); } } } XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation"); if (calculationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationIDRef = item.Attributes["id"].Name; WeatherLegCalculation ob = WeatherLegCalculation(); IDManager.SetID(calculationIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationIDRef = item.Attributes["href"].Name; } else { calculation = new WeatherLegCalculation(item); } } } XmlNodeList weatherIndexDataNodeList = xmlNode.SelectNodes("weatherIndexData"); if (weatherIndexDataNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in weatherIndexDataNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { weatherIndexDataIDRef = item.Attributes["id"].Name; WeatherIndexData ob = WeatherIndexData(); IDManager.SetID(weatherIndexDataIDRef, ob); } else if (item.Attributes.ToString() == "href") { weatherIndexDataIDRef = item.Attributes["href"].Name; } else { weatherIndexData = new WeatherIndexData(item); } } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; List<CommodityPremium> ob = new List<CommodityPremium>(); ob.Add(new CommodityPremium(item)); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium.Add(new CommodityPremium(item)); } } } XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing"); if (commonPricingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in commonPricingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commonPricingIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(commonPricingIDRef, ob); } else if (item.Attributes.ToString() == "href") { commonPricingIDRef = item.Attributes["href"].Name; } else { commonPricing = new XsdTypeBoolean(item); } } } XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption"); if (marketDisruptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in marketDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketDisruptionIDRef = item.Attributes["id"].Name; CommodityMarketDisruption ob = CommodityMarketDisruption(); IDManager.SetID(marketDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketDisruptionIDRef = item.Attributes["href"].Name; } else { marketDisruption = new CommodityMarketDisruption(item); } } } XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption"); if (settlementDisruptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementDisruptionIDRef = item.Attributes["id"].Name; CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum(); IDManager.SetID(settlementDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementDisruptionIDRef = item.Attributes["href"].Name; } else { settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item); } } } XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding"); if (roundingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in roundingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { roundingIDRef = item.Attributes["id"].Name; Rounding ob = Rounding(); IDManager.SetID(roundingIDRef, ob); } else if (item.Attributes.ToString() == "href") { roundingIDRef = item.Attributes["href"].Name; } else { rounding = new Rounding(item); } } } }
public ForwardSale(XmlNode xmlNode) : base(xmlNode) { XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset"); if (underlyingAssetNode != null) { if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) { if (underlyingAssetNode.Attributes["id"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value; Asset ob = new Asset(underlyingAssetNode); IDManager.SetID(underlyingAssetIDRef_, ob); } else if (underlyingAssetNode.Attributes["href"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value; } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } XmlNode basketNode = xmlNode.SelectSingleNode("basket"); if (basketNode != null) { if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) { if (basketNode.Attributes["id"] != null) { basketIDRef_ = basketNode.Attributes["id"].Value; Basket ob = new Basket(basketNode); IDManager.SetID(basketIDRef_, ob); } else if (basketNode.Attributes["href"] != null) { basketIDRef_ = basketNode.Attributes["href"].Value; } else { basket_ = new Basket(basketNode); } } else { basket_ = new Basket(basketNode); } } XmlNode bondNode = xmlNode.SelectSingleNode("bond"); if (bondNode != null) { if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) { if (bondNode.Attributes["id"] != null) { bondIDRef_ = bondNode.Attributes["id"].Value; Bond ob = new Bond(bondNode); IDManager.SetID(bondIDRef_, ob); } else if (bondNode.Attributes["href"] != null) { bondIDRef_ = bondNode.Attributes["href"].Value; } else { bond_ = new Bond(bondNode); } } else { bond_ = new Bond(bondNode); } } XmlNode cashNode = xmlNode.SelectSingleNode("cash"); if (cashNode != null) { if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) { if (cashNode.Attributes["id"] != null) { cashIDRef_ = cashNode.Attributes["id"].Value; Cash ob = new Cash(cashNode); IDManager.SetID(cashIDRef_, ob); } else if (cashNode.Attributes["href"] != null) { cashIDRef_ = cashNode.Attributes["href"].Value; } else { cash_ = new Cash(cashNode); } } else { cash_ = new Cash(cashNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond"); if (convertibleBondNode != null) { if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) { if (convertibleBondNode.Attributes["id"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value; ConvertibleBond ob = new ConvertibleBond(convertibleBondNode); IDManager.SetID(convertibleBondIDRef_, ob); } else if (convertibleBondNode.Attributes["href"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value; } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } XmlNode equityNode = xmlNode.SelectSingleNode("equity"); if (equityNode != null) { if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) { if (equityNode.Attributes["id"] != null) { equityIDRef_ = equityNode.Attributes["id"].Value; EquityAsset ob = new EquityAsset(equityNode); IDManager.SetID(equityIDRef_, ob); } else if (equityNode.Attributes["href"] != null) { equityIDRef_ = equityNode.Attributes["href"].Value; } else { equity_ = new EquityAsset(equityNode); } } else { equity_ = new EquityAsset(equityNode); } } XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund"); if (exchangeTradedFundNode != null) { if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) { if (exchangeTradedFundNode.Attributes["id"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value; ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode); IDManager.SetID(exchangeTradedFundIDRef_, ob); } else if (exchangeTradedFundNode.Attributes["href"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value; } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } XmlNode futureNode = xmlNode.SelectSingleNode("future"); if (futureNode != null) { if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) { if (futureNode.Attributes["id"] != null) { futureIDRef_ = futureNode.Attributes["id"].Value; Future ob = new Future(futureNode); IDManager.SetID(futureIDRef_, ob); } else if (futureNode.Attributes["href"] != null) { futureIDRef_ = futureNode.Attributes["href"].Value; } else { future_ = new Future(futureNode); } } else { future_ = new Future(futureNode); } } XmlNode indexNode = xmlNode.SelectSingleNode("index"); if (indexNode != null) { if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) { if (indexNode.Attributes["id"] != null) { indexIDRef_ = indexNode.Attributes["id"].Value; Index ob = new Index(indexNode); IDManager.SetID(indexIDRef_, ob); } else if (indexNode.Attributes["href"] != null) { indexIDRef_ = indexNode.Attributes["href"].Value; } else { index_ = new Index(indexNode); } } else { index_ = new Index(indexNode); } } XmlNode loanNode = xmlNode.SelectSingleNode("loan"); if (loanNode != null) { if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) { if (loanNode.Attributes["id"] != null) { loanIDRef_ = loanNode.Attributes["id"].Value; Loan ob = new Loan(loanNode); IDManager.SetID(loanIDRef_, ob); } else if (loanNode.Attributes["href"] != null) { loanIDRef_ = loanNode.Attributes["href"].Value; } else { loan_ = new Loan(loanNode); } } else { loan_ = new Loan(loanNode); } } XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage"); if (mortgageNode != null) { if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) { if (mortgageNode.Attributes["id"] != null) { mortgageIDRef_ = mortgageNode.Attributes["id"].Value; Mortgage ob = new Mortgage(mortgageNode); IDManager.SetID(mortgageIDRef_, ob); } else if (mortgageNode.Attributes["href"] != null) { mortgageIDRef_ = mortgageNode.Attributes["href"].Value; } else { mortgage_ = new Mortgage(mortgageNode); } } else { mortgage_ = new Mortgage(mortgageNode); } } XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund"); if (mutualFundNode != null) { if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) { if (mutualFundNode.Attributes["id"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value; MutualFund ob = new MutualFund(mutualFundNode); IDManager.SetID(mutualFundIDRef_, ob); } else if (mutualFundNode.Attributes["href"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value; } else { mutualFund_ = new MutualFund(mutualFundNode); } } else { mutualFund_ = new MutualFund(mutualFundNode); } } XmlNode forwardSaleDateNode = xmlNode.SelectSingleNode("forwardSaleDate"); if (forwardSaleDateNode != null) { if (forwardSaleDateNode.Attributes["href"] != null || forwardSaleDateNode.Attributes["id"] != null) { if (forwardSaleDateNode.Attributes["id"] != null) { forwardSaleDateIDRef_ = forwardSaleDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(forwardSaleDateNode); IDManager.SetID(forwardSaleDateIDRef_, ob); } else if (forwardSaleDateNode.Attributes["href"] != null) { forwardSaleDateIDRef_ = forwardSaleDateNode.Attributes["href"].Value; } else { forwardSaleDate_ = new XsdTypeDate(forwardSaleDateNode); } } else { forwardSaleDate_ = new XsdTypeDate(forwardSaleDateNode); } } XmlNode settlementNode = xmlNode.SelectSingleNode("settlement"); if (settlementNode != null) { if (settlementNode.Attributes["href"] != null || settlementNode.Attributes["id"] != null) { if (settlementNode.Attributes["id"] != null) { settlementIDRef_ = settlementNode.Attributes["id"].Value; Payment ob = new Payment(settlementNode); IDManager.SetID(settlementIDRef_, ob); } else if (settlementNode.Attributes["href"] != null) { settlementIDRef_ = settlementNode.Attributes["href"].Value; } else { settlement_ = new Payment(settlementNode); } } else { settlement_ = new Payment(settlementNode); } } XmlNode priceNode = xmlNode.SelectSingleNode("price"); if (priceNode != null) { if (priceNode.Attributes["href"] != null || priceNode.Attributes["id"] != null) { if (priceNode.Attributes["id"] != null) { priceIDRef_ = priceNode.Attributes["id"].Value; Price ob = new Price(priceNode); IDManager.SetID(priceIDRef_, ob); } else if (priceNode.Attributes["href"] != null) { priceIDRef_ = priceNode.Attributes["href"].Value; } else { price_ = new Price(priceNode); } } else { price_ = new Price(priceNode); } } }
public InstrumentSet(XmlNode xmlNode) { 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 curveInstrumentNodeList = xmlNode.SelectNodes("curveInstrument"); if (curveInstrumentNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in curveInstrumentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { curveInstrumentIDRef = item.Attributes["id"].Name; Asset ob = Asset(); IDManager.SetID(curveInstrumentIDRef, ob); } else if (item.Attributes.ToString() == "href") { curveInstrumentIDRef = item.Attributes["href"].Name; } else { curveInstrument = new Asset(item); } } } XmlNodeList depositNodeList = xmlNode.SelectNodes("deposit"); if (depositNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in depositNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { depositIDRef = item.Attributes["id"].Name; Deposit ob = Deposit(); IDManager.SetID(depositIDRef, ob); } else if (item.Attributes.ToString() == "href") { depositIDRef = item.Attributes["href"].Name; } else { deposit = new Deposit(item); } } } XmlNodeList fxNodeList = xmlNode.SelectNodes("fx"); if (fxNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in fxNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fxIDRef = item.Attributes["id"].Name; FxRateAsset ob = FxRateAsset(); IDManager.SetID(fxIDRef, ob); } else if (item.Attributes.ToString() == "href") { fxIDRef = item.Attributes["href"].Name; } else { fx = new FxRateAsset(item); } } } XmlNodeList rateIndexNodeList = xmlNode.SelectNodes("rateIndex"); if (rateIndexNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in rateIndexNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateIndexIDRef = item.Attributes["id"].Name; RateIndex ob = RateIndex(); IDManager.SetID(rateIndexIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateIndexIDRef = item.Attributes["href"].Name; } else { rateIndex = new RateIndex(item); } } } XmlNodeList simpleCreditDefaultSwapNodeList = xmlNode.SelectNodes("simpleCreditDefaultSwap"); if (simpleCreditDefaultSwapNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in simpleCreditDefaultSwapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { simpleCreditDefaultSwapIDRef = item.Attributes["id"].Name; SimpleCreditDefaultSwap ob = SimpleCreditDefaultSwap(); IDManager.SetID(simpleCreditDefaultSwapIDRef, ob); } else if (item.Attributes.ToString() == "href") { simpleCreditDefaultSwapIDRef = item.Attributes["href"].Name; } else { simpleCreditDefaultSwap = new SimpleCreditDefaultSwap(item); } } } XmlNodeList simpleFraNodeList = xmlNode.SelectNodes("simpleFra"); if (simpleFraNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in simpleFraNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { simpleFraIDRef = item.Attributes["id"].Name; SimpleFra ob = SimpleFra(); IDManager.SetID(simpleFraIDRef, ob); } else if (item.Attributes.ToString() == "href") { simpleFraIDRef = item.Attributes["href"].Name; } else { simpleFra = new SimpleFra(item); } } } XmlNodeList simpleIrSwapNodeList = xmlNode.SelectNodes("simpleIrSwap"); if (simpleIrSwapNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in simpleIrSwapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { simpleIrSwapIDRef = item.Attributes["id"].Name; SimpleIRSwap ob = SimpleIRSwap(); IDManager.SetID(simpleIrSwapIDRef, ob); } else if (item.Attributes.ToString() == "href") { simpleIrSwapIDRef = item.Attributes["href"].Name; } else { simpleIrSwap = new SimpleIRSwap(item); } } } }
public BasketConstituent(XmlNode xmlNode) { 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 constituentWeightNodeList = xmlNode.SelectNodes("constituentWeight"); if (constituentWeightNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in constituentWeightNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { constituentWeightIDRef = item.Attributes["id"].Name; ConstituentWeight ob = ConstituentWeight(); IDManager.SetID(constituentWeightIDRef, ob); } else if (item.Attributes.ToString() == "href") { constituentWeightIDRef = item.Attributes["href"].Name; } else { constituentWeight = new ConstituentWeight(item); } } } XmlNodeList dividendPayoutNodeList = xmlNode.SelectNodes("dividendPayout"); if (dividendPayoutNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in dividendPayoutNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { dividendPayoutIDRef = item.Attributes["id"].Name; DividendPayout ob = DividendPayout(); IDManager.SetID(dividendPayoutIDRef, ob); } else if (item.Attributes.ToString() == "href") { dividendPayoutIDRef = item.Attributes["href"].Name; } else { dividendPayout = new DividendPayout(item); } } } XmlNodeList underlyerPriceNodeList = xmlNode.SelectNodes("underlyerPrice"); if (underlyerPriceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in underlyerPriceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyerPriceIDRef = item.Attributes["id"].Name; Price ob = Price(); IDManager.SetID(underlyerPriceIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyerPriceIDRef = item.Attributes["href"].Name; } else { underlyerPrice = new Price(item); } } } XmlNodeList underlyerNotionalNodeList = xmlNode.SelectNodes("underlyerNotional"); if (underlyerNotionalNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in underlyerNotionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyerNotionalIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(underlyerNotionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyerNotionalIDRef = item.Attributes["href"].Name; } else { underlyerNotional = new Money(item); } } } XmlNodeList underlyerSpreadNodeList = xmlNode.SelectNodes("underlyerSpread"); if (underlyerSpreadNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in underlyerSpreadNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyerSpreadIDRef = item.Attributes["id"].Name; SpreadScheduleReference ob = SpreadScheduleReference(); IDManager.SetID(underlyerSpreadIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyerSpreadIDRef = item.Attributes["href"].Name; } else { underlyerSpread = new SpreadScheduleReference(item); } } } XmlNodeList couponPaymentNodeList = xmlNode.SelectNodes("couponPayment"); if (couponPaymentNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in couponPaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { couponPaymentIDRef = item.Attributes["id"].Name; PendingPayment ob = PendingPayment(); IDManager.SetID(couponPaymentIDRef, ob); } else if (item.Attributes.ToString() == "href") { couponPaymentIDRef = item.Attributes["href"].Name; } else { couponPayment = new PendingPayment(item); } } } }
public SingleUnderlyer(XmlNode xmlNode) { XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset"); if (underlyingAssetNode != null) { if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) { if (underlyingAssetNode.Attributes["id"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value; Asset ob = new Asset(underlyingAssetNode); IDManager.SetID(underlyingAssetIDRef_, ob); } else if (underlyingAssetNode.Attributes["href"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value; } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } XmlNode basketNode = xmlNode.SelectSingleNode("basket"); if (basketNode != null) { if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) { if (basketNode.Attributes["id"] != null) { basketIDRef_ = basketNode.Attributes["id"].Value; Basket ob = new Basket(basketNode); IDManager.SetID(basketIDRef_, ob); } else if (basketNode.Attributes["href"] != null) { basketIDRef_ = basketNode.Attributes["href"].Value; } else { basket_ = new Basket(basketNode); } } else { basket_ = new Basket(basketNode); } } XmlNode bondNode = xmlNode.SelectSingleNode("bond"); if (bondNode != null) { if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) { if (bondNode.Attributes["id"] != null) { bondIDRef_ = bondNode.Attributes["id"].Value; Bond ob = new Bond(bondNode); IDManager.SetID(bondIDRef_, ob); } else if (bondNode.Attributes["href"] != null) { bondIDRef_ = bondNode.Attributes["href"].Value; } else { bond_ = new Bond(bondNode); } } else { bond_ = new Bond(bondNode); } } XmlNode cashNode = xmlNode.SelectSingleNode("cash"); if (cashNode != null) { if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) { if (cashNode.Attributes["id"] != null) { cashIDRef_ = cashNode.Attributes["id"].Value; Cash ob = new Cash(cashNode); IDManager.SetID(cashIDRef_, ob); } else if (cashNode.Attributes["href"] != null) { cashIDRef_ = cashNode.Attributes["href"].Value; } else { cash_ = new Cash(cashNode); } } else { cash_ = new Cash(cashNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond"); if (convertibleBondNode != null) { if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) { if (convertibleBondNode.Attributes["id"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value; ConvertibleBond ob = new ConvertibleBond(convertibleBondNode); IDManager.SetID(convertibleBondIDRef_, ob); } else if (convertibleBondNode.Attributes["href"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value; } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } XmlNode equityNode = xmlNode.SelectSingleNode("equity"); if (equityNode != null) { if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) { if (equityNode.Attributes["id"] != null) { equityIDRef_ = equityNode.Attributes["id"].Value; EquityAsset ob = new EquityAsset(equityNode); IDManager.SetID(equityIDRef_, ob); } else if (equityNode.Attributes["href"] != null) { equityIDRef_ = equityNode.Attributes["href"].Value; } else { equity_ = new EquityAsset(equityNode); } } else { equity_ = new EquityAsset(equityNode); } } XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund"); if (exchangeTradedFundNode != null) { if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) { if (exchangeTradedFundNode.Attributes["id"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value; ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode); IDManager.SetID(exchangeTradedFundIDRef_, ob); } else if (exchangeTradedFundNode.Attributes["href"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value; } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } XmlNode futureNode = xmlNode.SelectSingleNode("future"); if (futureNode != null) { if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) { if (futureNode.Attributes["id"] != null) { futureIDRef_ = futureNode.Attributes["id"].Value; Future ob = new Future(futureNode); IDManager.SetID(futureIDRef_, ob); } else if (futureNode.Attributes["href"] != null) { futureIDRef_ = futureNode.Attributes["href"].Value; } else { future_ = new Future(futureNode); } } else { future_ = new Future(futureNode); } } XmlNode indexNode = xmlNode.SelectSingleNode("index"); if (indexNode != null) { if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) { if (indexNode.Attributes["id"] != null) { indexIDRef_ = indexNode.Attributes["id"].Value; Index ob = new Index(indexNode); IDManager.SetID(indexIDRef_, ob); } else if (indexNode.Attributes["href"] != null) { indexIDRef_ = indexNode.Attributes["href"].Value; } else { index_ = new Index(indexNode); } } else { index_ = new Index(indexNode); } } XmlNode loanNode = xmlNode.SelectSingleNode("loan"); if (loanNode != null) { if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) { if (loanNode.Attributes["id"] != null) { loanIDRef_ = loanNode.Attributes["id"].Value; Loan ob = new Loan(loanNode); IDManager.SetID(loanIDRef_, ob); } else if (loanNode.Attributes["href"] != null) { loanIDRef_ = loanNode.Attributes["href"].Value; } else { loan_ = new Loan(loanNode); } } else { loan_ = new Loan(loanNode); } } XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage"); if (mortgageNode != null) { if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) { if (mortgageNode.Attributes["id"] != null) { mortgageIDRef_ = mortgageNode.Attributes["id"].Value; Mortgage ob = new Mortgage(mortgageNode); IDManager.SetID(mortgageIDRef_, ob); } else if (mortgageNode.Attributes["href"] != null) { mortgageIDRef_ = mortgageNode.Attributes["href"].Value; } else { mortgage_ = new Mortgage(mortgageNode); } } else { mortgage_ = new Mortgage(mortgageNode); } } XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund"); if (mutualFundNode != null) { if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) { if (mutualFundNode.Attributes["id"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value; MutualFund ob = new MutualFund(mutualFundNode); IDManager.SetID(mutualFundIDRef_, ob); } else if (mutualFundNode.Attributes["href"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value; } else { mutualFund_ = new MutualFund(mutualFundNode); } } else { mutualFund_ = new MutualFund(mutualFundNode); } } XmlNode openUnitsNode = xmlNode.SelectSingleNode("openUnits"); if (openUnitsNode != null) { if (openUnitsNode.Attributes["href"] != null || openUnitsNode.Attributes["id"] != null) { if (openUnitsNode.Attributes["id"] != null) { openUnitsIDRef_ = openUnitsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(openUnitsNode); IDManager.SetID(openUnitsIDRef_, ob); } else if (openUnitsNode.Attributes["href"] != null) { openUnitsIDRef_ = openUnitsNode.Attributes["href"].Value; } else { openUnits_ = new XsdTypeDecimal(openUnitsNode); } } else { openUnits_ = new XsdTypeDecimal(openUnitsNode); } } XmlNode dividendPayoutNode = xmlNode.SelectSingleNode("dividendPayout"); if (dividendPayoutNode != null) { if (dividendPayoutNode.Attributes["href"] != null || dividendPayoutNode.Attributes["id"] != null) { if (dividendPayoutNode.Attributes["id"] != null) { dividendPayoutIDRef_ = dividendPayoutNode.Attributes["id"].Value; DividendPayout ob = new DividendPayout(dividendPayoutNode); IDManager.SetID(dividendPayoutIDRef_, ob); } else if (dividendPayoutNode.Attributes["href"] != null) { dividendPayoutIDRef_ = dividendPayoutNode.Attributes["href"].Value; } else { dividendPayout_ = new DividendPayout(dividendPayoutNode); } } else { dividendPayout_ = new DividendPayout(dividendPayoutNode); } } XmlNode couponPaymentNode = xmlNode.SelectSingleNode("couponPayment"); if (couponPaymentNode != null) { if (couponPaymentNode.Attributes["href"] != null || couponPaymentNode.Attributes["id"] != null) { if (couponPaymentNode.Attributes["id"] != null) { couponPaymentIDRef_ = couponPaymentNode.Attributes["id"].Value; PendingPayment ob = new PendingPayment(couponPaymentNode); IDManager.SetID(couponPaymentIDRef_, ob); } else if (couponPaymentNode.Attributes["href"] != null) { couponPaymentIDRef_ = couponPaymentNode.Attributes["href"].Value; } else { couponPayment_ = new PendingPayment(couponPaymentNode); } } else { couponPayment_ = new PendingPayment(couponPaymentNode); } } XmlNode averageDailyTradingVolumeNode = xmlNode.SelectSingleNode("averageDailyTradingVolume"); if (averageDailyTradingVolumeNode != null) { if (averageDailyTradingVolumeNode.Attributes["href"] != null || averageDailyTradingVolumeNode.Attributes["id"] != null) { if (averageDailyTradingVolumeNode.Attributes["id"] != null) { averageDailyTradingVolumeIDRef_ = averageDailyTradingVolumeNode.Attributes["id"].Value; AverageDailyTradingVolumeLimit ob = new AverageDailyTradingVolumeLimit(averageDailyTradingVolumeNode); IDManager.SetID(averageDailyTradingVolumeIDRef_, ob); } else if (averageDailyTradingVolumeNode.Attributes["href"] != null) { averageDailyTradingVolumeIDRef_ = averageDailyTradingVolumeNode.Attributes["href"].Value; } else { averageDailyTradingVolume_ = new AverageDailyTradingVolumeLimit(averageDailyTradingVolumeNode); } } else { averageDailyTradingVolume_ = new AverageDailyTradingVolumeLimit(averageDailyTradingVolumeNode); } } XmlNode depositoryReceiptNode = xmlNode.SelectSingleNode("depositoryReceipt"); if (depositoryReceiptNode != null) { if (depositoryReceiptNode.Attributes["href"] != null || depositoryReceiptNode.Attributes["id"] != null) { if (depositoryReceiptNode.Attributes["id"] != null) { depositoryReceiptIDRef_ = depositoryReceiptNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(depositoryReceiptNode); IDManager.SetID(depositoryReceiptIDRef_, ob); } else if (depositoryReceiptNode.Attributes["href"] != null) { depositoryReceiptIDRef_ = depositoryReceiptNode.Attributes["href"].Value; } else { depositoryReceipt_ = new XsdTypeBoolean(depositoryReceiptNode); } } else { depositoryReceipt_ = new XsdTypeBoolean(depositoryReceiptNode); } } }
public InstrumentSet(XmlNode xmlNode) { XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset"); if (underlyingAssetNode != null) { if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) { if (underlyingAssetNode.Attributes["id"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value; Asset ob = new Asset(underlyingAssetNode); IDManager.SetID(underlyingAssetIDRef_, ob); } else if (underlyingAssetNode.Attributes["href"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value; } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } XmlNode basketNode = xmlNode.SelectSingleNode("basket"); if (basketNode != null) { if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) { if (basketNode.Attributes["id"] != null) { basketIDRef_ = basketNode.Attributes["id"].Value; Basket ob = new Basket(basketNode); IDManager.SetID(basketIDRef_, ob); } else if (basketNode.Attributes["href"] != null) { basketIDRef_ = basketNode.Attributes["href"].Value; } else { basket_ = new Basket(basketNode); } } else { basket_ = new Basket(basketNode); } } XmlNode bondNode = xmlNode.SelectSingleNode("bond"); if (bondNode != null) { if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) { if (bondNode.Attributes["id"] != null) { bondIDRef_ = bondNode.Attributes["id"].Value; Bond ob = new Bond(bondNode); IDManager.SetID(bondIDRef_, ob); } else if (bondNode.Attributes["href"] != null) { bondIDRef_ = bondNode.Attributes["href"].Value; } else { bond_ = new Bond(bondNode); } } else { bond_ = new Bond(bondNode); } } XmlNode cashNode = xmlNode.SelectSingleNode("cash"); if (cashNode != null) { if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) { if (cashNode.Attributes["id"] != null) { cashIDRef_ = cashNode.Attributes["id"].Value; Cash ob = new Cash(cashNode); IDManager.SetID(cashIDRef_, ob); } else if (cashNode.Attributes["href"] != null) { cashIDRef_ = cashNode.Attributes["href"].Value; } else { cash_ = new Cash(cashNode); } } else { cash_ = new Cash(cashNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond"); if (convertibleBondNode != null) { if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) { if (convertibleBondNode.Attributes["id"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value; ConvertibleBond ob = new ConvertibleBond(convertibleBondNode); IDManager.SetID(convertibleBondIDRef_, ob); } else if (convertibleBondNode.Attributes["href"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value; } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } XmlNode equityNode = xmlNode.SelectSingleNode("equity"); if (equityNode != null) { if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) { if (equityNode.Attributes["id"] != null) { equityIDRef_ = equityNode.Attributes["id"].Value; EquityAsset ob = new EquityAsset(equityNode); IDManager.SetID(equityIDRef_, ob); } else if (equityNode.Attributes["href"] != null) { equityIDRef_ = equityNode.Attributes["href"].Value; } else { equity_ = new EquityAsset(equityNode); } } else { equity_ = new EquityAsset(equityNode); } } XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund"); if (exchangeTradedFundNode != null) { if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) { if (exchangeTradedFundNode.Attributes["id"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value; ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode); IDManager.SetID(exchangeTradedFundIDRef_, ob); } else if (exchangeTradedFundNode.Attributes["href"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value; } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } XmlNode futureNode = xmlNode.SelectSingleNode("future"); if (futureNode != null) { if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) { if (futureNode.Attributes["id"] != null) { futureIDRef_ = futureNode.Attributes["id"].Value; Future ob = new Future(futureNode); IDManager.SetID(futureIDRef_, ob); } else if (futureNode.Attributes["href"] != null) { futureIDRef_ = futureNode.Attributes["href"].Value; } else { future_ = new Future(futureNode); } } else { future_ = new Future(futureNode); } } XmlNode indexNode = xmlNode.SelectSingleNode("index"); if (indexNode != null) { if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) { if (indexNode.Attributes["id"] != null) { indexIDRef_ = indexNode.Attributes["id"].Value; Index ob = new Index(indexNode); IDManager.SetID(indexIDRef_, ob); } else if (indexNode.Attributes["href"] != null) { indexIDRef_ = indexNode.Attributes["href"].Value; } else { index_ = new Index(indexNode); } } else { index_ = new Index(indexNode); } } XmlNode loanNode = xmlNode.SelectSingleNode("loan"); if (loanNode != null) { if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) { if (loanNode.Attributes["id"] != null) { loanIDRef_ = loanNode.Attributes["id"].Value; Loan ob = new Loan(loanNode); IDManager.SetID(loanIDRef_, ob); } else if (loanNode.Attributes["href"] != null) { loanIDRef_ = loanNode.Attributes["href"].Value; } else { loan_ = new Loan(loanNode); } } else { loan_ = new Loan(loanNode); } } XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage"); if (mortgageNode != null) { if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) { if (mortgageNode.Attributes["id"] != null) { mortgageIDRef_ = mortgageNode.Attributes["id"].Value; Mortgage ob = new Mortgage(mortgageNode); IDManager.SetID(mortgageIDRef_, ob); } else if (mortgageNode.Attributes["href"] != null) { mortgageIDRef_ = mortgageNode.Attributes["href"].Value; } else { mortgage_ = new Mortgage(mortgageNode); } } else { mortgage_ = new Mortgage(mortgageNode); } } XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund"); if (mutualFundNode != null) { if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) { if (mutualFundNode.Attributes["id"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value; MutualFund ob = new MutualFund(mutualFundNode); IDManager.SetID(mutualFundIDRef_, ob); } else if (mutualFundNode.Attributes["href"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value; } else { mutualFund_ = new MutualFund(mutualFundNode); } } else { mutualFund_ = new MutualFund(mutualFundNode); } } XmlNode curveInstrumentNode = xmlNode.SelectSingleNode("curveInstrument"); if (curveInstrumentNode != null) { if (curveInstrumentNode.Attributes["href"] != null || curveInstrumentNode.Attributes["id"] != null) { if (curveInstrumentNode.Attributes["id"] != null) { curveInstrumentIDRef_ = curveInstrumentNode.Attributes["id"].Value; Asset ob = new Asset(curveInstrumentNode); IDManager.SetID(curveInstrumentIDRef_, ob); } else if (curveInstrumentNode.Attributes["href"] != null) { curveInstrumentIDRef_ = curveInstrumentNode.Attributes["href"].Value; } else { curveInstrument_ = new Asset(curveInstrumentNode); } } else { curveInstrument_ = new Asset(curveInstrumentNode); } } XmlNode depositNode = xmlNode.SelectSingleNode("deposit"); if (depositNode != null) { if (depositNode.Attributes["href"] != null || depositNode.Attributes["id"] != null) { if (depositNode.Attributes["id"] != null) { depositIDRef_ = depositNode.Attributes["id"].Value; Deposit ob = new Deposit(depositNode); IDManager.SetID(depositIDRef_, ob); } else if (depositNode.Attributes["href"] != null) { depositIDRef_ = depositNode.Attributes["href"].Value; } else { deposit_ = new Deposit(depositNode); } } else { deposit_ = new Deposit(depositNode); } } XmlNode fxNode = xmlNode.SelectSingleNode("fx"); if (fxNode != null) { if (fxNode.Attributes["href"] != null || fxNode.Attributes["id"] != null) { if (fxNode.Attributes["id"] != null) { fxIDRef_ = fxNode.Attributes["id"].Value; FxRateAsset ob = new FxRateAsset(fxNode); IDManager.SetID(fxIDRef_, ob); } else if (fxNode.Attributes["href"] != null) { fxIDRef_ = fxNode.Attributes["href"].Value; } else { fx_ = new FxRateAsset(fxNode); } } else { fx_ = new FxRateAsset(fxNode); } } XmlNode rateIndexNode = xmlNode.SelectSingleNode("rateIndex"); if (rateIndexNode != null) { if (rateIndexNode.Attributes["href"] != null || rateIndexNode.Attributes["id"] != null) { if (rateIndexNode.Attributes["id"] != null) { rateIndexIDRef_ = rateIndexNode.Attributes["id"].Value; RateIndex ob = new RateIndex(rateIndexNode); IDManager.SetID(rateIndexIDRef_, ob); } else if (rateIndexNode.Attributes["href"] != null) { rateIndexIDRef_ = rateIndexNode.Attributes["href"].Value; } else { rateIndex_ = new RateIndex(rateIndexNode); } } else { rateIndex_ = new RateIndex(rateIndexNode); } } XmlNode simpleCreditDefaultSwapNode = xmlNode.SelectSingleNode("simpleCreditDefaultSwap"); if (simpleCreditDefaultSwapNode != null) { if (simpleCreditDefaultSwapNode.Attributes["href"] != null || simpleCreditDefaultSwapNode.Attributes["id"] != null) { if (simpleCreditDefaultSwapNode.Attributes["id"] != null) { simpleCreditDefaultSwapIDRef_ = simpleCreditDefaultSwapNode.Attributes["id"].Value; SimpleCreditDefaultSwap ob = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode); IDManager.SetID(simpleCreditDefaultSwapIDRef_, ob); } else if (simpleCreditDefaultSwapNode.Attributes["href"] != null) { simpleCreditDefaultSwapIDRef_ = simpleCreditDefaultSwapNode.Attributes["href"].Value; } else { simpleCreditDefaultSwap_ = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode); } } else { simpleCreditDefaultSwap_ = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode); } } XmlNode simpleFraNode = xmlNode.SelectSingleNode("simpleFra"); if (simpleFraNode != null) { if (simpleFraNode.Attributes["href"] != null || simpleFraNode.Attributes["id"] != null) { if (simpleFraNode.Attributes["id"] != null) { simpleFraIDRef_ = simpleFraNode.Attributes["id"].Value; SimpleFra ob = new SimpleFra(simpleFraNode); IDManager.SetID(simpleFraIDRef_, ob); } else if (simpleFraNode.Attributes["href"] != null) { simpleFraIDRef_ = simpleFraNode.Attributes["href"].Value; } else { simpleFra_ = new SimpleFra(simpleFraNode); } } else { simpleFra_ = new SimpleFra(simpleFraNode); } } XmlNode simpleIrSwapNode = xmlNode.SelectSingleNode("simpleIrSwap"); if (simpleIrSwapNode != null) { if (simpleIrSwapNode.Attributes["href"] != null || simpleIrSwapNode.Attributes["id"] != null) { if (simpleIrSwapNode.Attributes["id"] != null) { simpleIrSwapIDRef_ = simpleIrSwapNode.Attributes["id"].Value; SimpleIRSwap ob = new SimpleIRSwap(simpleIrSwapNode); IDManager.SetID(simpleIrSwapIDRef_, ob); } else if (simpleIrSwapNode.Attributes["href"] != null) { simpleIrSwapIDRef_ = simpleIrSwapNode.Attributes["href"].Value; } else { simpleIrSwap_ = new SimpleIRSwap(simpleIrSwapNode); } } else { simpleIrSwap_ = new SimpleIRSwap(simpleIrSwapNode); } } }
public PricingStructurePoint(XmlNode xmlNode) { XmlNode coordinateNode = xmlNode.SelectSingleNode("coordinate"); if (coordinateNode != null) { if (coordinateNode.Attributes["href"] != null || coordinateNode.Attributes["id"] != null) { if (coordinateNode.Attributes["id"] != null) { coordinateIDRef_ = coordinateNode.Attributes["id"].Value; PricingDataPointCoordinate ob = new PricingDataPointCoordinate(coordinateNode); IDManager.SetID(coordinateIDRef_, ob); } else if (coordinateNode.Attributes["href"] != null) { coordinateIDRef_ = coordinateNode.Attributes["href"].Value; } else { coordinate_ = new PricingDataPointCoordinate(coordinateNode); } } else { coordinate_ = new PricingDataPointCoordinate(coordinateNode); } } XmlNode coordinateReferenceNode = xmlNode.SelectSingleNode("coordinateReference"); if (coordinateReferenceNode != null) { if (coordinateReferenceNode.Attributes["href"] != null || coordinateReferenceNode.Attributes["id"] != null) { if (coordinateReferenceNode.Attributes["id"] != null) { coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["id"].Value; PricingDataPointCoordinateReference ob = new PricingDataPointCoordinateReference(coordinateReferenceNode); IDManager.SetID(coordinateReferenceIDRef_, ob); } else if (coordinateReferenceNode.Attributes["href"] != null) { coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["href"].Value; } else { coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode); } } else { coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode); } } XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset"); if (underlyingAssetNode != null) { if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) { if (underlyingAssetNode.Attributes["id"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value; Asset ob = new Asset(underlyingAssetNode); IDManager.SetID(underlyingAssetIDRef_, ob); } else if (underlyingAssetNode.Attributes["href"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value; } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } XmlNode basketNode = xmlNode.SelectSingleNode("basket"); if (basketNode != null) { if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) { if (basketNode.Attributes["id"] != null) { basketIDRef_ = basketNode.Attributes["id"].Value; Basket ob = new Basket(basketNode); IDManager.SetID(basketIDRef_, ob); } else if (basketNode.Attributes["href"] != null) { basketIDRef_ = basketNode.Attributes["href"].Value; } else { basket_ = new Basket(basketNode); } } else { basket_ = new Basket(basketNode); } } XmlNode bondNode = xmlNode.SelectSingleNode("bond"); if (bondNode != null) { if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) { if (bondNode.Attributes["id"] != null) { bondIDRef_ = bondNode.Attributes["id"].Value; Bond ob = new Bond(bondNode); IDManager.SetID(bondIDRef_, ob); } else if (bondNode.Attributes["href"] != null) { bondIDRef_ = bondNode.Attributes["href"].Value; } else { bond_ = new Bond(bondNode); } } else { bond_ = new Bond(bondNode); } } XmlNode cashNode = xmlNode.SelectSingleNode("cash"); if (cashNode != null) { if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) { if (cashNode.Attributes["id"] != null) { cashIDRef_ = cashNode.Attributes["id"].Value; Cash ob = new Cash(cashNode); IDManager.SetID(cashIDRef_, ob); } else if (cashNode.Attributes["href"] != null) { cashIDRef_ = cashNode.Attributes["href"].Value; } else { cash_ = new Cash(cashNode); } } else { cash_ = new Cash(cashNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond"); if (convertibleBondNode != null) { if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) { if (convertibleBondNode.Attributes["id"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value; ConvertibleBond ob = new ConvertibleBond(convertibleBondNode); IDManager.SetID(convertibleBondIDRef_, ob); } else if (convertibleBondNode.Attributes["href"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value; } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } XmlNode equityNode = xmlNode.SelectSingleNode("equity"); if (equityNode != null) { if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) { if (equityNode.Attributes["id"] != null) { equityIDRef_ = equityNode.Attributes["id"].Value; EquityAsset ob = new EquityAsset(equityNode); IDManager.SetID(equityIDRef_, ob); } else if (equityNode.Attributes["href"] != null) { equityIDRef_ = equityNode.Attributes["href"].Value; } else { equity_ = new EquityAsset(equityNode); } } else { equity_ = new EquityAsset(equityNode); } } XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund"); if (exchangeTradedFundNode != null) { if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) { if (exchangeTradedFundNode.Attributes["id"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value; ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode); IDManager.SetID(exchangeTradedFundIDRef_, ob); } else if (exchangeTradedFundNode.Attributes["href"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value; } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } XmlNode futureNode = xmlNode.SelectSingleNode("future"); if (futureNode != null) { if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) { if (futureNode.Attributes["id"] != null) { futureIDRef_ = futureNode.Attributes["id"].Value; Future ob = new Future(futureNode); IDManager.SetID(futureIDRef_, ob); } else if (futureNode.Attributes["href"] != null) { futureIDRef_ = futureNode.Attributes["href"].Value; } else { future_ = new Future(futureNode); } } else { future_ = new Future(futureNode); } } XmlNode indexNode = xmlNode.SelectSingleNode("index"); if (indexNode != null) { if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) { if (indexNode.Attributes["id"] != null) { indexIDRef_ = indexNode.Attributes["id"].Value; Index ob = new Index(indexNode); IDManager.SetID(indexIDRef_, ob); } else if (indexNode.Attributes["href"] != null) { indexIDRef_ = indexNode.Attributes["href"].Value; } else { index_ = new Index(indexNode); } } else { index_ = new Index(indexNode); } } XmlNode loanNode = xmlNode.SelectSingleNode("loan"); if (loanNode != null) { if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) { if (loanNode.Attributes["id"] != null) { loanIDRef_ = loanNode.Attributes["id"].Value; Loan ob = new Loan(loanNode); IDManager.SetID(loanIDRef_, ob); } else if (loanNode.Attributes["href"] != null) { loanIDRef_ = loanNode.Attributes["href"].Value; } else { loan_ = new Loan(loanNode); } } else { loan_ = new Loan(loanNode); } } XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage"); if (mortgageNode != null) { if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) { if (mortgageNode.Attributes["id"] != null) { mortgageIDRef_ = mortgageNode.Attributes["id"].Value; Mortgage ob = new Mortgage(mortgageNode); IDManager.SetID(mortgageIDRef_, ob); } else if (mortgageNode.Attributes["href"] != null) { mortgageIDRef_ = mortgageNode.Attributes["href"].Value; } else { mortgage_ = new Mortgage(mortgageNode); } } else { mortgage_ = new Mortgage(mortgageNode); } } XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund"); if (mutualFundNode != null) { if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) { if (mutualFundNode.Attributes["id"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value; MutualFund ob = new MutualFund(mutualFundNode); IDManager.SetID(mutualFundIDRef_, ob); } else if (mutualFundNode.Attributes["href"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value; } else { mutualFund_ = new MutualFund(mutualFundNode); } } else { mutualFund_ = new MutualFund(mutualFundNode); } } XmlNode underlyingAssetReferenceNode = xmlNode.SelectSingleNode("underlyingAssetReference"); if (underlyingAssetReferenceNode != null) { if (underlyingAssetReferenceNode.Attributes["href"] != null || underlyingAssetReferenceNode.Attributes["id"] != null) { if (underlyingAssetReferenceNode.Attributes["id"] != null) { underlyingAssetReferenceIDRef_ = underlyingAssetReferenceNode.Attributes["id"].Value; AssetReference ob = new AssetReference(underlyingAssetReferenceNode); IDManager.SetID(underlyingAssetReferenceIDRef_, ob); } else if (underlyingAssetReferenceNode.Attributes["href"] != null) { underlyingAssetReferenceIDRef_ = underlyingAssetReferenceNode.Attributes["href"].Value; } else { underlyingAssetReference_ = new AssetReference(underlyingAssetReferenceNode); } } else { underlyingAssetReference_ = new AssetReference(underlyingAssetReferenceNode); } } XmlNode valueNode = xmlNode.SelectSingleNode("value"); if (valueNode != null) { if (valueNode.Attributes["href"] != null || valueNode.Attributes["id"] != null) { if (valueNode.Attributes["id"] != null) { valueIDRef_ = valueNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(valueNode); IDManager.SetID(valueIDRef_, ob); } else if (valueNode.Attributes["href"] != null) { valueIDRef_ = valueNode.Attributes["href"].Value; } else { value_ = new XsdTypeDecimal(valueNode); } } else { value_ = new XsdTypeDecimal(valueNode); } } XmlNode measureTypeNode = xmlNode.SelectSingleNode("measureType"); if (measureTypeNode != null) { if (measureTypeNode.Attributes["href"] != null || measureTypeNode.Attributes["id"] != null) { if (measureTypeNode.Attributes["id"] != null) { measureTypeIDRef_ = measureTypeNode.Attributes["id"].Value; AssetMeasureType ob = new AssetMeasureType(measureTypeNode); IDManager.SetID(measureTypeIDRef_, ob); } else if (measureTypeNode.Attributes["href"] != null) { measureTypeIDRef_ = measureTypeNode.Attributes["href"].Value; } else { measureType_ = new AssetMeasureType(measureTypeNode); } } else { measureType_ = new AssetMeasureType(measureTypeNode); } } XmlNode quoteUnitsNode = xmlNode.SelectSingleNode("quoteUnits"); if (quoteUnitsNode != null) { if (quoteUnitsNode.Attributes["href"] != null || quoteUnitsNode.Attributes["id"] != null) { if (quoteUnitsNode.Attributes["id"] != null) { quoteUnitsIDRef_ = quoteUnitsNode.Attributes["id"].Value; PriceQuoteUnits ob = new PriceQuoteUnits(quoteUnitsNode); IDManager.SetID(quoteUnitsIDRef_, ob); } else if (quoteUnitsNode.Attributes["href"] != null) { quoteUnitsIDRef_ = quoteUnitsNode.Attributes["href"].Value; } else { quoteUnits_ = new PriceQuoteUnits(quoteUnitsNode); } } else { quoteUnits_ = new PriceQuoteUnits(quoteUnitsNode); } } XmlNode sideNode = xmlNode.SelectSingleNode("side"); if (sideNode != null) { if (sideNode.Attributes["href"] != null || sideNode.Attributes["id"] != null) { if (sideNode.Attributes["id"] != null) { sideIDRef_ = sideNode.Attributes["id"].Value; QuotationSideEnum ob = new QuotationSideEnum(sideNode); IDManager.SetID(sideIDRef_, ob); } else if (sideNode.Attributes["href"] != null) { sideIDRef_ = sideNode.Attributes["href"].Value; } else { side_ = new QuotationSideEnum(sideNode); } } else { side_ = new QuotationSideEnum(sideNode); } } XmlNode currencyNode = xmlNode.SelectSingleNode("currency"); if (currencyNode != null) { if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) { if (currencyNode.Attributes["id"] != null) { currencyIDRef_ = currencyNode.Attributes["id"].Value; Currency ob = new Currency(currencyNode); IDManager.SetID(currencyIDRef_, ob); } else if (currencyNode.Attributes["href"] != null) { currencyIDRef_ = currencyNode.Attributes["href"].Value; } else { currency_ = new Currency(currencyNode); } } else { currency_ = new Currency(currencyNode); } } XmlNode currencyTypeNode = xmlNode.SelectSingleNode("currencyType"); if (currencyTypeNode != null) { if (currencyTypeNode.Attributes["href"] != null || currencyTypeNode.Attributes["id"] != null) { if (currencyTypeNode.Attributes["id"] != null) { currencyTypeIDRef_ = currencyTypeNode.Attributes["id"].Value; ReportingCurrencyType ob = new ReportingCurrencyType(currencyTypeNode); IDManager.SetID(currencyTypeIDRef_, ob); } else if (currencyTypeNode.Attributes["href"] != null) { currencyTypeIDRef_ = currencyTypeNode.Attributes["href"].Value; } else { currencyType_ = new ReportingCurrencyType(currencyTypeNode); } } else { currencyType_ = new ReportingCurrencyType(currencyTypeNode); } } XmlNode timingNode = xmlNode.SelectSingleNode("timing"); if (timingNode != null) { if (timingNode.Attributes["href"] != null || timingNode.Attributes["id"] != null) { if (timingNode.Attributes["id"] != null) { timingIDRef_ = timingNode.Attributes["id"].Value; QuoteTiming ob = new QuoteTiming(timingNode); IDManager.SetID(timingIDRef_, ob); } else if (timingNode.Attributes["href"] != null) { timingIDRef_ = timingNode.Attributes["href"].Value; } else { timing_ = new QuoteTiming(timingNode); } } else { timing_ = new QuoteTiming(timingNode); } } XmlNode businessCenterNode = xmlNode.SelectSingleNode("businessCenter"); if (businessCenterNode != null) { if (businessCenterNode.Attributes["href"] != null || businessCenterNode.Attributes["id"] != null) { if (businessCenterNode.Attributes["id"] != null) { businessCenterIDRef_ = businessCenterNode.Attributes["id"].Value; BusinessCenter ob = new BusinessCenter(businessCenterNode); IDManager.SetID(businessCenterIDRef_, ob); } else if (businessCenterNode.Attributes["href"] != null) { businessCenterIDRef_ = businessCenterNode.Attributes["href"].Value; } else { businessCenter_ = new BusinessCenter(businessCenterNode); } } else { businessCenter_ = new BusinessCenter(businessCenterNode); } } XmlNode exchangeIdNode = xmlNode.SelectSingleNode("exchangeId"); if (exchangeIdNode != null) { if (exchangeIdNode.Attributes["href"] != null || exchangeIdNode.Attributes["id"] != null) { if (exchangeIdNode.Attributes["id"] != null) { exchangeIdIDRef_ = exchangeIdNode.Attributes["id"].Value; ExchangeId ob = new ExchangeId(exchangeIdNode); IDManager.SetID(exchangeIdIDRef_, ob); } else if (exchangeIdNode.Attributes["href"] != null) { exchangeIdIDRef_ = exchangeIdNode.Attributes["href"].Value; } else { exchangeId_ = new ExchangeId(exchangeIdNode); } } else { exchangeId_ = new ExchangeId(exchangeIdNode); } } XmlNodeList informationSourceNodeList = xmlNode.SelectNodes("informationSource"); if (informationSourceNodeList != null) { this.informationSource_ = new List<InformationSource>(); foreach (XmlNode item in informationSourceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { informationSourceIDRef_ = item.Attributes["id"].Value; informationSource_.Add(new InformationSource(item)); IDManager.SetID(informationSourceIDRef_, informationSource_[informationSource_.Count - 1 ]); } else if (item.Attributes["href"] != null) { informationSourceIDRef_ = item.Attributes["href"].Value; } else { informationSource_.Add(new InformationSource(item)); } } else { informationSource_.Add(new InformationSource(item)); } } } XmlNode pricingModelNode = xmlNode.SelectSingleNode("pricingModel"); if (pricingModelNode != null) { if (pricingModelNode.Attributes["href"] != null || pricingModelNode.Attributes["id"] != null) { if (pricingModelNode.Attributes["id"] != null) { pricingModelIDRef_ = pricingModelNode.Attributes["id"].Value; PricingModel ob = new PricingModel(pricingModelNode); IDManager.SetID(pricingModelIDRef_, ob); } else if (pricingModelNode.Attributes["href"] != null) { pricingModelIDRef_ = pricingModelNode.Attributes["href"].Value; } else { pricingModel_ = new PricingModel(pricingModelNode); } } else { pricingModel_ = new PricingModel(pricingModelNode); } } XmlNode timeNode = xmlNode.SelectSingleNode("time"); if (timeNode != null) { if (timeNode.Attributes["href"] != null || timeNode.Attributes["id"] != null) { if (timeNode.Attributes["id"] != null) { timeIDRef_ = timeNode.Attributes["id"].Value; XsdTypeDateTime ob = new XsdTypeDateTime(timeNode); IDManager.SetID(timeIDRef_, ob); } else if (timeNode.Attributes["href"] != null) { timeIDRef_ = timeNode.Attributes["href"].Value; } else { time_ = new XsdTypeDateTime(timeNode); } } else { time_ = new XsdTypeDateTime(timeNode); } } XmlNode valuationDateNode = xmlNode.SelectSingleNode("valuationDate"); if (valuationDateNode != null) { if (valuationDateNode.Attributes["href"] != null || valuationDateNode.Attributes["id"] != null) { if (valuationDateNode.Attributes["id"] != null) { valuationDateIDRef_ = valuationDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(valuationDateNode); IDManager.SetID(valuationDateIDRef_, ob); } else if (valuationDateNode.Attributes["href"] != null) { valuationDateIDRef_ = valuationDateNode.Attributes["href"].Value; } else { valuationDate_ = new XsdTypeDate(valuationDateNode); } } else { valuationDate_ = new XsdTypeDate(valuationDateNode); } } XmlNode expiryTimeNode = xmlNode.SelectSingleNode("expiryTime"); if (expiryTimeNode != null) { if (expiryTimeNode.Attributes["href"] != null || expiryTimeNode.Attributes["id"] != null) { if (expiryTimeNode.Attributes["id"] != null) { expiryTimeIDRef_ = expiryTimeNode.Attributes["id"].Value; XsdTypeDateTime ob = new XsdTypeDateTime(expiryTimeNode); IDManager.SetID(expiryTimeIDRef_, ob); } else if (expiryTimeNode.Attributes["href"] != null) { expiryTimeIDRef_ = expiryTimeNode.Attributes["href"].Value; } else { expiryTime_ = new XsdTypeDateTime(expiryTimeNode); } } else { expiryTime_ = new XsdTypeDateTime(expiryTimeNode); } } XmlNode cashflowTypeNode = xmlNode.SelectSingleNode("cashflowType"); if (cashflowTypeNode != null) { if (cashflowTypeNode.Attributes["href"] != null || cashflowTypeNode.Attributes["id"] != null) { if (cashflowTypeNode.Attributes["id"] != null) { cashflowTypeIDRef_ = cashflowTypeNode.Attributes["id"].Value; CashflowType ob = new CashflowType(cashflowTypeNode); IDManager.SetID(cashflowTypeIDRef_, ob); } else if (cashflowTypeNode.Attributes["href"] != null) { cashflowTypeIDRef_ = cashflowTypeNode.Attributes["href"].Value; } else { cashflowType_ = new CashflowType(cashflowTypeNode); } } else { cashflowType_ = new CashflowType(cashflowTypeNode); } } }
public FloatingPriceLeg(XmlNode xmlNode) : base(xmlNode) { XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates"); if (calculationDatesNode != null) { if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null) { if (calculationDatesNode.Attributes["id"] != null) { calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value; AdjustableDates ob = new AdjustableDates(calculationDatesNode); IDManager.SetID(calculationDatesIDRef_, ob); } else if (calculationDatesNode.Attributes["href"] != null) { calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value; } else { calculationDates_ = new AdjustableDates(calculationDatesNode); } } else { calculationDates_ = new AdjustableDates(calculationDatesNode); } } XmlNode calculationPeriodsNode = xmlNode.SelectSingleNode("calculationPeriods"); if (calculationPeriodsNode != null) { if (calculationPeriodsNode.Attributes["href"] != null || calculationPeriodsNode.Attributes["id"] != null) { if (calculationPeriodsNode.Attributes["id"] != null) { calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["id"].Value; AdjustableDates ob = new AdjustableDates(calculationPeriodsNode); IDManager.SetID(calculationPeriodsIDRef_, ob); } else if (calculationPeriodsNode.Attributes["href"] != null) { calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["href"].Value; } else { calculationPeriods_ = new AdjustableDates(calculationPeriodsNode); } } else { calculationPeriods_ = new AdjustableDates(calculationPeriodsNode); } } XmlNode calculationPeriodsScheduleNode = xmlNode.SelectSingleNode("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNode != null) { if (calculationPeriodsScheduleNode.Attributes["href"] != null || calculationPeriodsScheduleNode.Attributes["id"] != null) { if (calculationPeriodsScheduleNode.Attributes["id"] != null) { calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["id"].Value; CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); IDManager.SetID(calculationPeriodsScheduleIDRef_, ob); } else if (calculationPeriodsScheduleNode.Attributes["href"] != null) { calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["href"].Value; } else { calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); } } else { calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); } } XmlNode calculationPeriodsReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsReference"); if (calculationPeriodsReferenceNode != null) { if (calculationPeriodsReferenceNode.Attributes["href"] != null || calculationPeriodsReferenceNode.Attributes["id"] != null) { if (calculationPeriodsReferenceNode.Attributes["id"] != null) { calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["id"].Value; CalculationPeriodsReference ob = new CalculationPeriodsReference(calculationPeriodsReferenceNode); IDManager.SetID(calculationPeriodsReferenceIDRef_, ob); } else if (calculationPeriodsReferenceNode.Attributes["href"] != null) { calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["href"].Value; } else { calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode); } } else { calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode); } } XmlNode calculationPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNode != null) { if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null || calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) { if (calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["id"].Value; CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef_, ob); } else if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null) { calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["href"].Value; } else { calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); } } else { calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); } } XmlNode calculationPeriodsDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNode != null) { if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null || calculationPeriodsDatesReferenceNode.Attributes["id"] != null) { if (calculationPeriodsDatesReferenceNode.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["id"].Value; CalculationPeriodsDatesReference ob = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); IDManager.SetID(calculationPeriodsDatesReferenceIDRef_, ob); } else if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null) { calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["href"].Value; } else { calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); } } else { calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode notionalQuantityScheduleNode = xmlNode.SelectSingleNode("notionalQuantitySchedule"); if (notionalQuantityScheduleNode != null) { if (notionalQuantityScheduleNode.Attributes["href"] != null || notionalQuantityScheduleNode.Attributes["id"] != null) { if (notionalQuantityScheduleNode.Attributes["id"] != null) { notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["id"].Value; CommodityNotionalQuantitySchedule ob = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode); IDManager.SetID(notionalQuantityScheduleIDRef_, ob); } else if (notionalQuantityScheduleNode.Attributes["href"] != null) { notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["href"].Value; } else { notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode); } } else { notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode); } } XmlNode notionalQuantityNode = xmlNode.SelectSingleNode("notionalQuantity"); if (notionalQuantityNode != null) { if (notionalQuantityNode.Attributes["href"] != null || notionalQuantityNode.Attributes["id"] != null) { if (notionalQuantityNode.Attributes["id"] != null) { notionalQuantityIDRef_ = notionalQuantityNode.Attributes["id"].Value; CommodityNotionalQuantity ob = new CommodityNotionalQuantity(notionalQuantityNode); IDManager.SetID(notionalQuantityIDRef_, ob); } else if (notionalQuantityNode.Attributes["href"] != null) { notionalQuantityIDRef_ = notionalQuantityNode.Attributes["href"].Value; } else { notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode); } } else { notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode); } } XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity"); if (settlementPeriodsNotionalQuantityNodeList != null) { this.settlementPeriodsNotionalQuantity_ = new List<CommoditySettlementPeriodsNotionalQuantity>(); foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["id"].Value; settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); IDManager.SetID(settlementPeriodsNotionalQuantityIDRef_, settlementPeriodsNotionalQuantity_[settlementPeriodsNotionalQuantity_.Count - 1 ]); } else if (item.Attributes["href"] != null) { settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["href"].Value; } else { settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } else { settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } } XmlNode totalNotionalQuantityNode = xmlNode.SelectSingleNode("totalNotionalQuantity"); if (totalNotionalQuantityNode != null) { if (totalNotionalQuantityNode.Attributes["href"] != null || totalNotionalQuantityNode.Attributes["id"] != null) { if (totalNotionalQuantityNode.Attributes["id"] != null) { totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(totalNotionalQuantityNode); IDManager.SetID(totalNotionalQuantityIDRef_, ob); } else if (totalNotionalQuantityNode.Attributes["href"] != null) { totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["href"].Value; } else { totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode); } } else { totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode); } } XmlNode quantityReferenceNode = xmlNode.SelectSingleNode("quantityReference"); if (quantityReferenceNode != null) { if (quantityReferenceNode.Attributes["href"] != null || quantityReferenceNode.Attributes["id"] != null) { if (quantityReferenceNode.Attributes["id"] != null) { quantityReferenceIDRef_ = quantityReferenceNode.Attributes["id"].Value; QuantityReference ob = new QuantityReference(quantityReferenceNode); IDManager.SetID(quantityReferenceIDRef_, ob); } else if (quantityReferenceNode.Attributes["href"] != null) { quantityReferenceIDRef_ = quantityReferenceNode.Attributes["href"].Value; } else { quantityReference_ = new QuantityReference(quantityReferenceNode); } } else { quantityReference_ = new QuantityReference(quantityReferenceNode); } } XmlNode calculationNode = xmlNode.SelectSingleNode("calculation"); if (calculationNode != null) { if (calculationNode.Attributes["href"] != null || calculationNode.Attributes["id"] != null) { if (calculationNode.Attributes["id"] != null) { calculationIDRef_ = calculationNode.Attributes["id"].Value; FloatingLegCalculation ob = new FloatingLegCalculation(calculationNode); IDManager.SetID(calculationIDRef_, ob); } else if (calculationNode.Attributes["href"] != null) { calculationIDRef_ = calculationNode.Attributes["href"].Value; } else { calculation_ = new FloatingLegCalculation(calculationNode); } } else { calculation_ = new FloatingLegCalculation(calculationNode); } } XmlNode relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates"); if (relativePaymentDatesNode != null) { if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null) { if (relativePaymentDatesNode.Attributes["id"] != null) { relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value; CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode); IDManager.SetID(relativePaymentDatesIDRef_, ob); } else if (relativePaymentDatesNode.Attributes["href"] != null) { relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value; } else { relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode); } } else { relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode); } } XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates"); if (paymentDatesNode != null) { if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null) { if (paymentDatesNode.Attributes["id"] != null) { paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value; AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode); IDManager.SetID(paymentDatesIDRef_, ob); } else if (paymentDatesNode.Attributes["href"] != null) { paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value; } else { paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode); } } else { paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode); } } XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates"); if (masterAgreementPaymentDatesNode != null) { if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null) { if (masterAgreementPaymentDatesNode.Attributes["id"] != null) { masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode); IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob); } else if (masterAgreementPaymentDatesNode.Attributes["href"] != null) { masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value; } else { masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode); } } else { masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode); } } XmlNode flatRateNode = xmlNode.SelectSingleNode("flatRate"); if (flatRateNode != null) { if (flatRateNode.Attributes["href"] != null || flatRateNode.Attributes["id"] != null) { if (flatRateNode.Attributes["id"] != null) { flatRateIDRef_ = flatRateNode.Attributes["id"].Value; FlatRateEnum ob = new FlatRateEnum(flatRateNode); IDManager.SetID(flatRateIDRef_, ob); } else if (flatRateNode.Attributes["href"] != null) { flatRateIDRef_ = flatRateNode.Attributes["href"].Value; } else { flatRate_ = new FlatRateEnum(flatRateNode); } } else { flatRate_ = new FlatRateEnum(flatRateNode); } } XmlNode flatRateAmountNode = xmlNode.SelectSingleNode("flatRateAmount"); if (flatRateAmountNode != null) { if (flatRateAmountNode.Attributes["href"] != null || flatRateAmountNode.Attributes["id"] != null) { if (flatRateAmountNode.Attributes["id"] != null) { flatRateAmountIDRef_ = flatRateAmountNode.Attributes["id"].Value; NonNegativeMoney ob = new NonNegativeMoney(flatRateAmountNode); IDManager.SetID(flatRateAmountIDRef_, ob); } else if (flatRateAmountNode.Attributes["href"] != null) { flatRateAmountIDRef_ = flatRateAmountNode.Attributes["href"].Value; } else { flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode); } } else { flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode); } } }
public TradeUnderlyer2(XmlNode xmlNode) { XmlNodeList floatingRateNodeList = xmlNode.SelectNodes("floatingRate"); if (floatingRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in floatingRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { floatingRateIDRef = item.Attributes["id"].Name; FloatingRate ob = FloatingRate(); IDManager.SetID(floatingRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { floatingRateIDRef = item.Attributes["href"].Name; } else { floatingRate = new FloatingRate(item); } } } XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate"); if (fixedRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in fixedRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fixedRateIDRef = item.Attributes["id"].Name; Schedule ob = Schedule(); IDManager.SetID(fixedRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { fixedRateIDRef = item.Attributes["href"].Name; } else { fixedRate = new Schedule(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 quotedCurrencyPairNodeList = xmlNode.SelectNodes("quotedCurrencyPair"); if (quotedCurrencyPairNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quotedCurrencyPairNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quotedCurrencyPairIDRef = item.Attributes["id"].Name; QuotedCurrencyPair ob = QuotedCurrencyPair(); IDManager.SetID(quotedCurrencyPairIDRef, ob); } else if (item.Attributes.ToString() == "href") { quotedCurrencyPairIDRef = item.Attributes["href"].Name; } else { quotedCurrencyPair = new QuotedCurrencyPair(item); } } } XmlNodeList referenceEntityNodeList = xmlNode.SelectNodes("referenceEntity"); if (referenceEntityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in referenceEntityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { referenceEntityIDRef = item.Attributes["id"].Name; LegalEntity ob = LegalEntity(); IDManager.SetID(referenceEntityIDRef, ob); } else if (item.Attributes.ToString() == "href") { referenceEntityIDRef = item.Attributes["href"].Name; } else { referenceEntity = new LegalEntity(item); } } } XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference"); if (payerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in payerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { payerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(payerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { payerPartyReferenceIDRef = item.Attributes["href"].Name; } else { payerPartyReference = new PartyReference(item); } } } XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference"); if (payerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in payerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { payerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(payerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { payerAccountReferenceIDRef = item.Attributes["href"].Name; } else { payerAccountReference = new AccountReference(item); } } } XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference"); if (receiverPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in receiverPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { receiverPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(receiverPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { receiverPartyReferenceIDRef = item.Attributes["href"].Name; } else { receiverPartyReference = new PartyReference(item); } } } XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference"); if (receiverAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in receiverAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { receiverAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(receiverAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { receiverAccountReferenceIDRef = item.Attributes["href"].Name; } else { receiverAccountReference = new AccountReference(item); } } } }
public FloatingPriceLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates"); if (calculationDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationDatesIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationDatesIDRef = item.Attributes["href"].Name; } else { calculationDates = new AdjustableDates(item); } } } XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods"); if (calculationPeriodsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsIDRef = item.Attributes["id"].Name; AdjustableDates ob = AdjustableDates(); IDManager.SetID(calculationPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsIDRef = item.Attributes["href"].Name; } else { calculationPeriods = new AdjustableDates(item); } } } XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleIDRef = item.Attributes["id"].Name; CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule(); IDManager.SetID(calculationPeriodsScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleIDRef = item.Attributes["href"].Name; } else { calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(item); } } } XmlNodeList calculationPeriodsReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsReference"); if (calculationPeriodsReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsReference ob = CalculationPeriodsReference(); IDManager.SetID(calculationPeriodsReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsReference = new CalculationPeriodsReference(item); } } } XmlNodeList calculationPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference(); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item); } } } XmlNodeList calculationPeriodsDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsDatesReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsDatesReference ob = CalculationPeriodsDatesReference(); IDManager.SetID(calculationPeriodsDatesReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsDatesReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsDatesReference = new CalculationPeriodsDatesReference(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 notionalQuantityScheduleNodeList = xmlNode.SelectNodes("notionalQuantitySchedule"); if (notionalQuantityScheduleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalQuantityScheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalQuantityScheduleIDRef = item.Attributes["id"].Name; CommodityNotionalQuantitySchedule ob = CommodityNotionalQuantitySchedule(); IDManager.SetID(notionalQuantityScheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalQuantityScheduleIDRef = item.Attributes["href"].Name; } else { notionalQuantitySchedule = new CommodityNotionalQuantitySchedule(item); } } } XmlNodeList notionalQuantityNodeList = xmlNode.SelectNodes("notionalQuantity"); if (notionalQuantityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalQuantityIDRef = item.Attributes["id"].Name; CommodityNotionalQuantity ob = CommodityNotionalQuantity(); IDManager.SetID(notionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalQuantityIDRef = item.Attributes["href"].Name; } else { notionalQuantity = new CommodityNotionalQuantity(item); } } } XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity"); foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementPeriodsNotionalQuantityIDRef = item.Attributes["id"].Name; List<CommoditySettlementPeriodsNotionalQuantity> ob = new List<CommoditySettlementPeriodsNotionalQuantity>(); ob.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); IDManager.SetID(settlementPeriodsNotionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementPeriodsNotionalQuantityIDRef = item.Attributes["href"].Name; } else { settlementPeriodsNotionalQuantity.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } } XmlNodeList totalNotionalQuantityNodeList = xmlNode.SelectNodes("totalNotionalQuantity"); if (totalNotionalQuantityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in totalNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { totalNotionalQuantityIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(totalNotionalQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { totalNotionalQuantityIDRef = item.Attributes["href"].Name; } else { totalNotionalQuantity = new XsdTypeDecimal(item); } } } XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference"); if (quantityReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in quantityReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { quantityReferenceIDRef = item.Attributes["id"].Name; QuantityReference ob = QuantityReference(); IDManager.SetID(quantityReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { quantityReferenceIDRef = item.Attributes["href"].Name; } else { quantityReference = new QuantityReference(item); } } } XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation"); if (calculationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationIDRef = item.Attributes["id"].Name; FloatingLegCalculation ob = FloatingLegCalculation(); IDManager.SetID(calculationIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationIDRef = item.Attributes["href"].Name; } else { calculation = new FloatingLegCalculation(item); } } } XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates"); if (relativePaymentDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in relativePaymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { relativePaymentDatesIDRef = item.Attributes["id"].Name; CommodityRelativePaymentDates ob = CommodityRelativePaymentDates(); IDManager.SetID(relativePaymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { relativePaymentDatesIDRef = item.Attributes["href"].Name; } else { relativePaymentDates = new CommodityRelativePaymentDates(item); } } } XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates"); if (paymentDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in paymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { paymentDatesIDRef = item.Attributes["id"].Name; AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset(); IDManager.SetID(paymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { paymentDatesIDRef = item.Attributes["href"].Name; } else { paymentDates = new AdjustableDatesOrRelativeDateOffset(item); } } } XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates"); if (masterAgreementPaymentDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in masterAgreementPaymentDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(masterAgreementPaymentDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name; } else { masterAgreementPaymentDates = new XsdTypeBoolean(item); } } } XmlNodeList flatRateNodeList = xmlNode.SelectNodes("flatRate"); if (flatRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in flatRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { flatRateIDRef = item.Attributes["id"].Name; FlatRateEnum ob = FlatRateEnum(); IDManager.SetID(flatRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { flatRateIDRef = item.Attributes["href"].Name; } else { flatRate = new FlatRateEnum(item); } } } XmlNodeList flatRateAmountNodeList = xmlNode.SelectNodes("flatRateAmount"); if (flatRateAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in flatRateAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { flatRateAmountIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(flatRateAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { flatRateAmountIDRef = item.Attributes["href"].Name; } else { flatRateAmount = new NonNegativeMoney(item); } } } }
public CommodityOption(XmlNode xmlNode) : base(xmlNode) { XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; PutCallEnum ob = new PutCallEnum(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new PutCallEnum(optionTypeNode); } } else { optionType_ = new PutCallEnum(optionTypeNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate"); if (effectiveDateNode != null) { if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) { if (effectiveDateNode.Attributes["id"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value; AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(effectiveDateNode); IDManager.SetID(effectiveDateIDRef_, ob); } else if (effectiveDateNode.Attributes["href"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value; } else { effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode); } } else { effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode); } } XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate"); if (terminationDateNode != null) { if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null) { if (terminationDateNode.Attributes["id"] != null) { terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value; AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(terminationDateNode); IDManager.SetID(terminationDateIDRef_, ob); } else if (terminationDateNode.Attributes["href"] != null) { terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value; } else { terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode); } } else { terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode); } } XmlNode calculationPeriodsScheduleNode = xmlNode.SelectSingleNode("calculationPeriodsSchedule"); if (calculationPeriodsScheduleNode != null) { if (calculationPeriodsScheduleNode.Attributes["href"] != null || calculationPeriodsScheduleNode.Attributes["id"] != null) { if (calculationPeriodsScheduleNode.Attributes["id"] != null) { calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["id"].Value; CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); IDManager.SetID(calculationPeriodsScheduleIDRef_, ob); } else if (calculationPeriodsScheduleNode.Attributes["href"] != null) { calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["href"].Value; } else { calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); } } else { calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode); } } XmlNode calculationPeriodsNode = xmlNode.SelectSingleNode("calculationPeriods"); if (calculationPeriodsNode != null) { if (calculationPeriodsNode.Attributes["href"] != null || calculationPeriodsNode.Attributes["id"] != null) { if (calculationPeriodsNode.Attributes["id"] != null) { calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["id"].Value; AdjustableDates ob = new AdjustableDates(calculationPeriodsNode); IDManager.SetID(calculationPeriodsIDRef_, ob); } else if (calculationPeriodsNode.Attributes["href"] != null) { calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["href"].Value; } else { calculationPeriods_ = new AdjustableDates(calculationPeriodsNode); } } else { calculationPeriods_ = new AdjustableDates(calculationPeriodsNode); } } XmlNode pricingDatesNode = xmlNode.SelectSingleNode("pricingDates"); if (pricingDatesNode != null) { if (pricingDatesNode.Attributes["href"] != null || pricingDatesNode.Attributes["id"] != null) { if (pricingDatesNode.Attributes["id"] != null) { pricingDatesIDRef_ = pricingDatesNode.Attributes["id"].Value; CommodityPricingDates ob = new CommodityPricingDates(pricingDatesNode); IDManager.SetID(pricingDatesIDRef_, ob); } else if (pricingDatesNode.Attributes["href"] != null) { pricingDatesIDRef_ = pricingDatesNode.Attributes["href"].Value; } else { pricingDates_ = new CommodityPricingDates(pricingDatesNode); } } else { pricingDates_ = new CommodityPricingDates(pricingDatesNode); } } XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod"); if (averagingMethodNode != null) { if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null) { if (averagingMethodNode.Attributes["id"] != null) { averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value; AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode); IDManager.SetID(averagingMethodIDRef_, ob); } else if (averagingMethodNode.Attributes["href"] != null) { averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value; } else { averagingMethod_ = new AveragingMethodEnum(averagingMethodNode); } } else { averagingMethod_ = new AveragingMethodEnum(averagingMethodNode); } } XmlNode notionalQuantityScheduleNode = xmlNode.SelectSingleNode("notionalQuantitySchedule"); if (notionalQuantityScheduleNode != null) { if (notionalQuantityScheduleNode.Attributes["href"] != null || notionalQuantityScheduleNode.Attributes["id"] != null) { if (notionalQuantityScheduleNode.Attributes["id"] != null) { notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["id"].Value; CommodityNotionalQuantitySchedule ob = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode); IDManager.SetID(notionalQuantityScheduleIDRef_, ob); } else if (notionalQuantityScheduleNode.Attributes["href"] != null) { notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["href"].Value; } else { notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode); } } else { notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode); } } XmlNode notionalQuantityNode = xmlNode.SelectSingleNode("notionalQuantity"); if (notionalQuantityNode != null) { if (notionalQuantityNode.Attributes["href"] != null || notionalQuantityNode.Attributes["id"] != null) { if (notionalQuantityNode.Attributes["id"] != null) { notionalQuantityIDRef_ = notionalQuantityNode.Attributes["id"].Value; CommodityNotionalQuantity ob = new CommodityNotionalQuantity(notionalQuantityNode); IDManager.SetID(notionalQuantityIDRef_, ob); } else if (notionalQuantityNode.Attributes["href"] != null) { notionalQuantityIDRef_ = notionalQuantityNode.Attributes["href"].Value; } else { notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode); } } else { notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode); } } XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity"); if (settlementPeriodsNotionalQuantityNodeList != null) { this.settlementPeriodsNotionalQuantity_ = new List<CommoditySettlementPeriodsNotionalQuantity>(); foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["id"].Value; settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); IDManager.SetID(settlementPeriodsNotionalQuantityIDRef_, settlementPeriodsNotionalQuantity_[settlementPeriodsNotionalQuantity_.Count - 1 ]); } else if (item.Attributes["href"] != null) { settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["href"].Value; } else { settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } else { settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item)); } } } XmlNode totalNotionalQuantityNode = xmlNode.SelectSingleNode("totalNotionalQuantity"); if (totalNotionalQuantityNode != null) { if (totalNotionalQuantityNode.Attributes["href"] != null || totalNotionalQuantityNode.Attributes["id"] != null) { if (totalNotionalQuantityNode.Attributes["id"] != null) { totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(totalNotionalQuantityNode); IDManager.SetID(totalNotionalQuantityIDRef_, ob); } else if (totalNotionalQuantityNode.Attributes["href"] != null) { totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["href"].Value; } else { totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode); } } else { totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode); } } XmlNode quantityReferenceNode = xmlNode.SelectSingleNode("quantityReference"); if (quantityReferenceNode != null) { if (quantityReferenceNode.Attributes["href"] != null || quantityReferenceNode.Attributes["id"] != null) { if (quantityReferenceNode.Attributes["id"] != null) { quantityReferenceIDRef_ = quantityReferenceNode.Attributes["id"].Value; QuantityReference ob = new QuantityReference(quantityReferenceNode); IDManager.SetID(quantityReferenceIDRef_, ob); } else if (quantityReferenceNode.Attributes["href"] != null) { quantityReferenceIDRef_ = quantityReferenceNode.Attributes["href"].Value; } else { quantityReference_ = new QuantityReference(quantityReferenceNode); } } else { quantityReference_ = new QuantityReference(quantityReferenceNode); } } XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; CommodityExercise ob = new CommodityExercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new CommodityExercise(exerciseNode); } } else { exercise_ = new CommodityExercise(exerciseNode); } } XmlNode strikePricePerUnitNode = xmlNode.SelectSingleNode("strikePricePerUnit"); if (strikePricePerUnitNode != null) { if (strikePricePerUnitNode.Attributes["href"] != null || strikePricePerUnitNode.Attributes["id"] != null) { if (strikePricePerUnitNode.Attributes["id"] != null) { strikePricePerUnitIDRef_ = strikePricePerUnitNode.Attributes["id"].Value; NonNegativeMoney ob = new NonNegativeMoney(strikePricePerUnitNode); IDManager.SetID(strikePricePerUnitIDRef_, ob); } else if (strikePricePerUnitNode.Attributes["href"] != null) { strikePricePerUnitIDRef_ = strikePricePerUnitNode.Attributes["href"].Value; } else { strikePricePerUnit_ = new NonNegativeMoney(strikePricePerUnitNode); } } else { strikePricePerUnit_ = new NonNegativeMoney(strikePricePerUnitNode); } } XmlNode strikePricePerUnitScheduleNode = xmlNode.SelectSingleNode("strikePricePerUnitSchedule"); if (strikePricePerUnitScheduleNode != null) { if (strikePricePerUnitScheduleNode.Attributes["href"] != null || strikePricePerUnitScheduleNode.Attributes["id"] != null) { if (strikePricePerUnitScheduleNode.Attributes["id"] != null) { strikePricePerUnitScheduleIDRef_ = strikePricePerUnitScheduleNode.Attributes["id"].Value; CommodityStrikeSchedule ob = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode); IDManager.SetID(strikePricePerUnitScheduleIDRef_, ob); } else if (strikePricePerUnitScheduleNode.Attributes["href"] != null) { strikePricePerUnitScheduleIDRef_ = strikePricePerUnitScheduleNode.Attributes["href"].Value; } else { strikePricePerUnitSchedule_ = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode); } } else { strikePricePerUnitSchedule_ = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode); } } XmlNode floatingStrikePricePerUnitNode = xmlNode.SelectSingleNode("floatingStrikePricePerUnit"); if (floatingStrikePricePerUnitNode != null) { if (floatingStrikePricePerUnitNode.Attributes["href"] != null || floatingStrikePricePerUnitNode.Attributes["id"] != null) { if (floatingStrikePricePerUnitNode.Attributes["id"] != null) { floatingStrikePricePerUnitIDRef_ = floatingStrikePricePerUnitNode.Attributes["id"].Value; FloatingStrikePrice ob = new FloatingStrikePrice(floatingStrikePricePerUnitNode); IDManager.SetID(floatingStrikePricePerUnitIDRef_, ob); } else if (floatingStrikePricePerUnitNode.Attributes["href"] != null) { floatingStrikePricePerUnitIDRef_ = floatingStrikePricePerUnitNode.Attributes["href"].Value; } else { floatingStrikePricePerUnit_ = new FloatingStrikePrice(floatingStrikePricePerUnitNode); } } else { floatingStrikePricePerUnit_ = new FloatingStrikePrice(floatingStrikePricePerUnitNode); } } XmlNode floatingStrikePricePerUnitScheduleNode = xmlNode.SelectSingleNode("floatingStrikePricePerUnitSchedule"); if (floatingStrikePricePerUnitScheduleNode != null) { if (floatingStrikePricePerUnitScheduleNode.Attributes["href"] != null || floatingStrikePricePerUnitScheduleNode.Attributes["id"] != null) { if (floatingStrikePricePerUnitScheduleNode.Attributes["id"] != null) { floatingStrikePricePerUnitScheduleIDRef_ = floatingStrikePricePerUnitScheduleNode.Attributes["id"].Value; CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode); IDManager.SetID(floatingStrikePricePerUnitScheduleIDRef_, ob); } else if (floatingStrikePricePerUnitScheduleNode.Attributes["href"] != null) { floatingStrikePricePerUnitScheduleIDRef_ = floatingStrikePricePerUnitScheduleNode.Attributes["href"].Value; } else { floatingStrikePricePerUnitSchedule_ = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode); } } else { floatingStrikePricePerUnitSchedule_ = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode); } } XmlNode commoditySwapNode = xmlNode.SelectSingleNode("commoditySwap"); if (commoditySwapNode != null) { if (commoditySwapNode.Attributes["href"] != null || commoditySwapNode.Attributes["id"] != null) { if (commoditySwapNode.Attributes["id"] != null) { commoditySwapIDRef_ = commoditySwapNode.Attributes["id"].Value; CommoditySwap ob = new CommoditySwap(commoditySwapNode); IDManager.SetID(commoditySwapIDRef_, ob); } else if (commoditySwapNode.Attributes["href"] != null) { commoditySwapIDRef_ = commoditySwapNode.Attributes["href"].Value; } else { commoditySwap_ = new CommoditySwap(commoditySwapNode); } } else { commoditySwap_ = new CommoditySwap(commoditySwapNode); } } XmlNode commodityForwardNode = xmlNode.SelectSingleNode("commodityForward"); if (commodityForwardNode != null) { if (commodityForwardNode.Attributes["href"] != null || commodityForwardNode.Attributes["id"] != null) { if (commodityForwardNode.Attributes["id"] != null) { commodityForwardIDRef_ = commodityForwardNode.Attributes["id"].Value; CommodityForward ob = new CommodityForward(commodityForwardNode); IDManager.SetID(commodityForwardIDRef_, ob); } else if (commodityForwardNode.Attributes["href"] != null) { commodityForwardIDRef_ = commodityForwardNode.Attributes["href"].Value; } else { commodityForward_ = new CommodityForward(commodityForwardNode); } } else { commodityForward_ = new CommodityForward(commodityForwardNode); } } XmlNode physicalExerciseNode = xmlNode.SelectSingleNode("physicalExercise"); if (physicalExerciseNode != null) { if (physicalExerciseNode.Attributes["href"] != null || physicalExerciseNode.Attributes["id"] != null) { if (physicalExerciseNode.Attributes["id"] != null) { physicalExerciseIDRef_ = physicalExerciseNode.Attributes["id"].Value; CommodityPhysicalExercise ob = new CommodityPhysicalExercise(physicalExerciseNode); IDManager.SetID(physicalExerciseIDRef_, ob); } else if (physicalExerciseNode.Attributes["href"] != null) { physicalExerciseIDRef_ = physicalExerciseNode.Attributes["href"].Value; } else { physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode); } } else { physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode); } } XmlNode weatherCalculationPeriodsNode = xmlNode.SelectSingleNode("weatherCalculationPeriods"); if (weatherCalculationPeriodsNode != null) { if (weatherCalculationPeriodsNode.Attributes["href"] != null || weatherCalculationPeriodsNode.Attributes["id"] != null) { if (weatherCalculationPeriodsNode.Attributes["id"] != null) { weatherCalculationPeriodsIDRef_ = weatherCalculationPeriodsNode.Attributes["id"].Value; WeatherCalculationPeriods ob = new WeatherCalculationPeriods(weatherCalculationPeriodsNode); IDManager.SetID(weatherCalculationPeriodsIDRef_, ob); } else if (weatherCalculationPeriodsNode.Attributes["href"] != null) { weatherCalculationPeriodsIDRef_ = weatherCalculationPeriodsNode.Attributes["href"].Value; } else { weatherCalculationPeriods_ = new WeatherCalculationPeriods(weatherCalculationPeriodsNode); } } else { weatherCalculationPeriods_ = new WeatherCalculationPeriods(weatherCalculationPeriodsNode); } } XmlNode weatherCalculationPeriodsReferenceNode = xmlNode.SelectSingleNode("weatherCalculationPeriodsReference"); if (weatherCalculationPeriodsReferenceNode != null) { if (weatherCalculationPeriodsReferenceNode.Attributes["href"] != null || weatherCalculationPeriodsReferenceNode.Attributes["id"] != null) { if (weatherCalculationPeriodsReferenceNode.Attributes["id"] != null) { weatherCalculationPeriodsReferenceIDRef_ = weatherCalculationPeriodsReferenceNode.Attributes["id"].Value; CalculationPeriodsReference ob = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode); IDManager.SetID(weatherCalculationPeriodsReferenceIDRef_, ob); } else if (weatherCalculationPeriodsReferenceNode.Attributes["href"] != null) { weatherCalculationPeriodsReferenceIDRef_ = weatherCalculationPeriodsReferenceNode.Attributes["href"].Value; } else { weatherCalculationPeriodsReference_ = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode); } } else { weatherCalculationPeriodsReference_ = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode); } } XmlNode weatherNotionalAmountNode = xmlNode.SelectSingleNode("weatherNotionalAmount"); if (weatherNotionalAmountNode != null) { if (weatherNotionalAmountNode.Attributes["href"] != null || weatherNotionalAmountNode.Attributes["id"] != null) { if (weatherNotionalAmountNode.Attributes["id"] != null) { weatherNotionalAmountIDRef_ = weatherNotionalAmountNode.Attributes["id"].Value; NonNegativeMoney ob = new NonNegativeMoney(weatherNotionalAmountNode); IDManager.SetID(weatherNotionalAmountIDRef_, ob); } else if (weatherNotionalAmountNode.Attributes["href"] != null) { weatherNotionalAmountIDRef_ = weatherNotionalAmountNode.Attributes["href"].Value; } else { weatherNotionalAmount_ = new NonNegativeMoney(weatherNotionalAmountNode); } } else { weatherNotionalAmount_ = new NonNegativeMoney(weatherNotionalAmountNode); } } XmlNode weatherIndexStrikeLevelNode = xmlNode.SelectSingleNode("weatherIndexStrikeLevel"); if (weatherIndexStrikeLevelNode != null) { if (weatherIndexStrikeLevelNode.Attributes["href"] != null || weatherIndexStrikeLevelNode.Attributes["id"] != null) { if (weatherIndexStrikeLevelNode.Attributes["id"] != null) { weatherIndexStrikeLevelIDRef_ = weatherIndexStrikeLevelNode.Attributes["id"].Value; WeatherIndex ob = new WeatherIndex(weatherIndexStrikeLevelNode); IDManager.SetID(weatherIndexStrikeLevelIDRef_, ob); } else if (weatherIndexStrikeLevelNode.Attributes["href"] != null) { weatherIndexStrikeLevelIDRef_ = weatherIndexStrikeLevelNode.Attributes["href"].Value; } else { weatherIndexStrikeLevel_ = new WeatherIndex(weatherIndexStrikeLevelNode); } } else { weatherIndexStrikeLevel_ = new WeatherIndex(weatherIndexStrikeLevelNode); } } XmlNode calculationNode = xmlNode.SelectSingleNode("calculation"); if (calculationNode != null) { if (calculationNode.Attributes["href"] != null || calculationNode.Attributes["id"] != null) { if (calculationNode.Attributes["id"] != null) { calculationIDRef_ = calculationNode.Attributes["id"].Value; WeatherLegCalculation ob = new WeatherLegCalculation(calculationNode); IDManager.SetID(calculationIDRef_, ob); } else if (calculationNode.Attributes["href"] != null) { calculationIDRef_ = calculationNode.Attributes["href"].Value; } else { calculation_ = new WeatherLegCalculation(calculationNode); } } else { calculation_ = new WeatherLegCalculation(calculationNode); } } XmlNode weatherIndexDataNode = xmlNode.SelectSingleNode("weatherIndexData"); if (weatherIndexDataNode != null) { if (weatherIndexDataNode.Attributes["href"] != null || weatherIndexDataNode.Attributes["id"] != null) { if (weatherIndexDataNode.Attributes["id"] != null) { weatherIndexDataIDRef_ = weatherIndexDataNode.Attributes["id"].Value; WeatherIndexData ob = new WeatherIndexData(weatherIndexDataNode); IDManager.SetID(weatherIndexDataIDRef_, ob); } else if (weatherIndexDataNode.Attributes["href"] != null) { weatherIndexDataIDRef_ = weatherIndexDataNode.Attributes["href"].Value; } else { weatherIndexData_ = new WeatherIndexData(weatherIndexDataNode); } } else { weatherIndexData_ = new WeatherIndexData(weatherIndexDataNode); } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList != null) { this.premium_ = new List<CommodityPremium>(); foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { premiumIDRef_ = item.Attributes["id"].Value; premium_.Add(new CommodityPremium(item)); IDManager.SetID(premiumIDRef_, premium_[premium_.Count - 1 ]); } else if (item.Attributes["href"] != null) { premiumIDRef_ = item.Attributes["href"].Value; } else { premium_.Add(new CommodityPremium(item)); } } else { premium_.Add(new CommodityPremium(item)); } } } XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing"); if (commonPricingNode != null) { if (commonPricingNode.Attributes["href"] != null || commonPricingNode.Attributes["id"] != null) { if (commonPricingNode.Attributes["id"] != null) { commonPricingIDRef_ = commonPricingNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(commonPricingNode); IDManager.SetID(commonPricingIDRef_, ob); } else if (commonPricingNode.Attributes["href"] != null) { commonPricingIDRef_ = commonPricingNode.Attributes["href"].Value; } else { commonPricing_ = new XsdTypeBoolean(commonPricingNode); } } else { commonPricing_ = new XsdTypeBoolean(commonPricingNode); } } XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption"); if (marketDisruptionNode != null) { if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) { if (marketDisruptionNode.Attributes["id"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value; CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode); IDManager.SetID(marketDisruptionIDRef_, ob); } else if (marketDisruptionNode.Attributes["href"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value; } else { marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode); } } else { marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode); } } XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption"); if (settlementDisruptionNode != null) { if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null) { if (settlementDisruptionNode.Attributes["id"] != null) { settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value; CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); IDManager.SetID(settlementDisruptionIDRef_, ob); } else if (settlementDisruptionNode.Attributes["href"] != null) { settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value; } else { settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); } } else { settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); } } XmlNode roundingNode = xmlNode.SelectSingleNode("rounding"); if (roundingNode != null) { if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null) { if (roundingNode.Attributes["id"] != null) { roundingIDRef_ = roundingNode.Attributes["id"].Value; Rounding ob = new Rounding(roundingNode); IDManager.SetID(roundingIDRef_, ob); } else if (roundingNode.Attributes["href"] != null) { roundingIDRef_ = roundingNode.Attributes["href"].Value; } else { rounding_ = new Rounding(roundingNode); } } else { rounding_ = new Rounding(roundingNode); } } }
public BasketConstituent(XmlNode xmlNode) { XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset"); if (underlyingAssetNode != null) { if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) { if (underlyingAssetNode.Attributes["id"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value; Asset ob = new Asset(underlyingAssetNode); IDManager.SetID(underlyingAssetIDRef_, ob); } else if (underlyingAssetNode.Attributes["href"] != null) { underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value; } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } else { underlyingAsset_ = new Asset(underlyingAssetNode); } } XmlNode basketNode = xmlNode.SelectSingleNode("basket"); if (basketNode != null) { if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) { if (basketNode.Attributes["id"] != null) { basketIDRef_ = basketNode.Attributes["id"].Value; Basket ob = new Basket(basketNode); IDManager.SetID(basketIDRef_, ob); } else if (basketNode.Attributes["href"] != null) { basketIDRef_ = basketNode.Attributes["href"].Value; } else { basket_ = new Basket(basketNode); } } else { basket_ = new Basket(basketNode); } } XmlNode bondNode = xmlNode.SelectSingleNode("bond"); if (bondNode != null) { if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) { if (bondNode.Attributes["id"] != null) { bondIDRef_ = bondNode.Attributes["id"].Value; Bond ob = new Bond(bondNode); IDManager.SetID(bondIDRef_, ob); } else if (bondNode.Attributes["href"] != null) { bondIDRef_ = bondNode.Attributes["href"].Value; } else { bond_ = new Bond(bondNode); } } else { bond_ = new Bond(bondNode); } } XmlNode cashNode = xmlNode.SelectSingleNode("cash"); if (cashNode != null) { if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) { if (cashNode.Attributes["id"] != null) { cashIDRef_ = cashNode.Attributes["id"].Value; Cash ob = new Cash(cashNode); IDManager.SetID(cashIDRef_, ob); } else if (cashNode.Attributes["href"] != null) { cashIDRef_ = cashNode.Attributes["href"].Value; } else { cash_ = new Cash(cashNode); } } else { cash_ = new Cash(cashNode); } } XmlNode commodityNode = xmlNode.SelectSingleNode("commodity"); if (commodityNode != null) { if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) { if (commodityNode.Attributes["id"] != null) { commodityIDRef_ = commodityNode.Attributes["id"].Value; Commodity ob = new Commodity(commodityNode); IDManager.SetID(commodityIDRef_, ob); } else if (commodityNode.Attributes["href"] != null) { commodityIDRef_ = commodityNode.Attributes["href"].Value; } else { commodity_ = new Commodity(commodityNode); } } else { commodity_ = new Commodity(commodityNode); } } XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond"); if (convertibleBondNode != null) { if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) { if (convertibleBondNode.Attributes["id"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value; ConvertibleBond ob = new ConvertibleBond(convertibleBondNode); IDManager.SetID(convertibleBondIDRef_, ob); } else if (convertibleBondNode.Attributes["href"] != null) { convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value; } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } else { convertibleBond_ = new ConvertibleBond(convertibleBondNode); } } XmlNode equityNode = xmlNode.SelectSingleNode("equity"); if (equityNode != null) { if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) { if (equityNode.Attributes["id"] != null) { equityIDRef_ = equityNode.Attributes["id"].Value; EquityAsset ob = new EquityAsset(equityNode); IDManager.SetID(equityIDRef_, ob); } else if (equityNode.Attributes["href"] != null) { equityIDRef_ = equityNode.Attributes["href"].Value; } else { equity_ = new EquityAsset(equityNode); } } else { equity_ = new EquityAsset(equityNode); } } XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund"); if (exchangeTradedFundNode != null) { if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) { if (exchangeTradedFundNode.Attributes["id"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value; ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode); IDManager.SetID(exchangeTradedFundIDRef_, ob); } else if (exchangeTradedFundNode.Attributes["href"] != null) { exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value; } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } else { exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode); } } XmlNode futureNode = xmlNode.SelectSingleNode("future"); if (futureNode != null) { if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) { if (futureNode.Attributes["id"] != null) { futureIDRef_ = futureNode.Attributes["id"].Value; Future ob = new Future(futureNode); IDManager.SetID(futureIDRef_, ob); } else if (futureNode.Attributes["href"] != null) { futureIDRef_ = futureNode.Attributes["href"].Value; } else { future_ = new Future(futureNode); } } else { future_ = new Future(futureNode); } } XmlNode indexNode = xmlNode.SelectSingleNode("index"); if (indexNode != null) { if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) { if (indexNode.Attributes["id"] != null) { indexIDRef_ = indexNode.Attributes["id"].Value; Index ob = new Index(indexNode); IDManager.SetID(indexIDRef_, ob); } else if (indexNode.Attributes["href"] != null) { indexIDRef_ = indexNode.Attributes["href"].Value; } else { index_ = new Index(indexNode); } } else { index_ = new Index(indexNode); } } XmlNode loanNode = xmlNode.SelectSingleNode("loan"); if (loanNode != null) { if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) { if (loanNode.Attributes["id"] != null) { loanIDRef_ = loanNode.Attributes["id"].Value; Loan ob = new Loan(loanNode); IDManager.SetID(loanIDRef_, ob); } else if (loanNode.Attributes["href"] != null) { loanIDRef_ = loanNode.Attributes["href"].Value; } else { loan_ = new Loan(loanNode); } } else { loan_ = new Loan(loanNode); } } XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage"); if (mortgageNode != null) { if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) { if (mortgageNode.Attributes["id"] != null) { mortgageIDRef_ = mortgageNode.Attributes["id"].Value; Mortgage ob = new Mortgage(mortgageNode); IDManager.SetID(mortgageIDRef_, ob); } else if (mortgageNode.Attributes["href"] != null) { mortgageIDRef_ = mortgageNode.Attributes["href"].Value; } else { mortgage_ = new Mortgage(mortgageNode); } } else { mortgage_ = new Mortgage(mortgageNode); } } XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund"); if (mutualFundNode != null) { if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) { if (mutualFundNode.Attributes["id"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value; MutualFund ob = new MutualFund(mutualFundNode); IDManager.SetID(mutualFundIDRef_, ob); } else if (mutualFundNode.Attributes["href"] != null) { mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value; } else { mutualFund_ = new MutualFund(mutualFundNode); } } else { mutualFund_ = new MutualFund(mutualFundNode); } } XmlNode constituentWeightNode = xmlNode.SelectSingleNode("constituentWeight"); if (constituentWeightNode != null) { if (constituentWeightNode.Attributes["href"] != null || constituentWeightNode.Attributes["id"] != null) { if (constituentWeightNode.Attributes["id"] != null) { constituentWeightIDRef_ = constituentWeightNode.Attributes["id"].Value; ConstituentWeight ob = new ConstituentWeight(constituentWeightNode); IDManager.SetID(constituentWeightIDRef_, ob); } else if (constituentWeightNode.Attributes["href"] != null) { constituentWeightIDRef_ = constituentWeightNode.Attributes["href"].Value; } else { constituentWeight_ = new ConstituentWeight(constituentWeightNode); } } else { constituentWeight_ = new ConstituentWeight(constituentWeightNode); } } XmlNode dividendPayoutNode = xmlNode.SelectSingleNode("dividendPayout"); if (dividendPayoutNode != null) { if (dividendPayoutNode.Attributes["href"] != null || dividendPayoutNode.Attributes["id"] != null) { if (dividendPayoutNode.Attributes["id"] != null) { dividendPayoutIDRef_ = dividendPayoutNode.Attributes["id"].Value; DividendPayout ob = new DividendPayout(dividendPayoutNode); IDManager.SetID(dividendPayoutIDRef_, ob); } else if (dividendPayoutNode.Attributes["href"] != null) { dividendPayoutIDRef_ = dividendPayoutNode.Attributes["href"].Value; } else { dividendPayout_ = new DividendPayout(dividendPayoutNode); } } else { dividendPayout_ = new DividendPayout(dividendPayoutNode); } } XmlNode underlyerPriceNode = xmlNode.SelectSingleNode("underlyerPrice"); if (underlyerPriceNode != null) { if (underlyerPriceNode.Attributes["href"] != null || underlyerPriceNode.Attributes["id"] != null) { if (underlyerPriceNode.Attributes["id"] != null) { underlyerPriceIDRef_ = underlyerPriceNode.Attributes["id"].Value; Price ob = new Price(underlyerPriceNode); IDManager.SetID(underlyerPriceIDRef_, ob); } else if (underlyerPriceNode.Attributes["href"] != null) { underlyerPriceIDRef_ = underlyerPriceNode.Attributes["href"].Value; } else { underlyerPrice_ = new Price(underlyerPriceNode); } } else { underlyerPrice_ = new Price(underlyerPriceNode); } } XmlNode underlyerNotionalNode = xmlNode.SelectSingleNode("underlyerNotional"); if (underlyerNotionalNode != null) { if (underlyerNotionalNode.Attributes["href"] != null || underlyerNotionalNode.Attributes["id"] != null) { if (underlyerNotionalNode.Attributes["id"] != null) { underlyerNotionalIDRef_ = underlyerNotionalNode.Attributes["id"].Value; Money ob = new Money(underlyerNotionalNode); IDManager.SetID(underlyerNotionalIDRef_, ob); } else if (underlyerNotionalNode.Attributes["href"] != null) { underlyerNotionalIDRef_ = underlyerNotionalNode.Attributes["href"].Value; } else { underlyerNotional_ = new Money(underlyerNotionalNode); } } else { underlyerNotional_ = new Money(underlyerNotionalNode); } } XmlNode underlyerSpreadNode = xmlNode.SelectSingleNode("underlyerSpread"); if (underlyerSpreadNode != null) { if (underlyerSpreadNode.Attributes["href"] != null || underlyerSpreadNode.Attributes["id"] != null) { if (underlyerSpreadNode.Attributes["id"] != null) { underlyerSpreadIDRef_ = underlyerSpreadNode.Attributes["id"].Value; SpreadScheduleReference ob = new SpreadScheduleReference(underlyerSpreadNode); IDManager.SetID(underlyerSpreadIDRef_, ob); } else if (underlyerSpreadNode.Attributes["href"] != null) { underlyerSpreadIDRef_ = underlyerSpreadNode.Attributes["href"].Value; } else { underlyerSpread_ = new SpreadScheduleReference(underlyerSpreadNode); } } else { underlyerSpread_ = new SpreadScheduleReference(underlyerSpreadNode); } } XmlNode couponPaymentNode = xmlNode.SelectSingleNode("couponPayment"); if (couponPaymentNode != null) { if (couponPaymentNode.Attributes["href"] != null || couponPaymentNode.Attributes["id"] != null) { if (couponPaymentNode.Attributes["id"] != null) { couponPaymentIDRef_ = couponPaymentNode.Attributes["id"].Value; PendingPayment ob = new PendingPayment(couponPaymentNode); IDManager.SetID(couponPaymentIDRef_, ob); } else if (couponPaymentNode.Attributes["href"] != null) { couponPaymentIDRef_ = couponPaymentNode.Attributes["href"].Value; } else { couponPayment_ = new PendingPayment(couponPaymentNode); } } else { couponPayment_ = new PendingPayment(couponPaymentNode); } } }
public SingleUnderlyer(XmlNode xmlNode) { 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 openUnitsNodeList = xmlNode.SelectNodes("openUnits"); if (openUnitsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in openUnitsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { openUnitsIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(openUnitsIDRef, ob); } else if (item.Attributes.ToString() == "href") { openUnitsIDRef = item.Attributes["href"].Name; } else { openUnits = new XsdTypeDecimal(item); } } } XmlNodeList dividendPayoutNodeList = xmlNode.SelectNodes("dividendPayout"); if (dividendPayoutNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in dividendPayoutNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { dividendPayoutIDRef = item.Attributes["id"].Name; DividendPayout ob = DividendPayout(); IDManager.SetID(dividendPayoutIDRef, ob); } else if (item.Attributes.ToString() == "href") { dividendPayoutIDRef = item.Attributes["href"].Name; } else { dividendPayout = new DividendPayout(item); } } } XmlNodeList couponPaymentNodeList = xmlNode.SelectNodes("couponPayment"); if (couponPaymentNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in couponPaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { couponPaymentIDRef = item.Attributes["id"].Name; PendingPayment ob = PendingPayment(); IDManager.SetID(couponPaymentIDRef, ob); } else if (item.Attributes.ToString() == "href") { couponPaymentIDRef = item.Attributes["href"].Name; } else { couponPayment = new PendingPayment(item); } } } XmlNodeList averageDailyTradingVolumeNodeList = xmlNode.SelectNodes("averageDailyTradingVolume"); if (averageDailyTradingVolumeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in averageDailyTradingVolumeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averageDailyTradingVolumeIDRef = item.Attributes["id"].Name; AverageDailyTradingVolumeLimit ob = AverageDailyTradingVolumeLimit(); IDManager.SetID(averageDailyTradingVolumeIDRef, ob); } else if (item.Attributes.ToString() == "href") { averageDailyTradingVolumeIDRef = item.Attributes["href"].Name; } else { averageDailyTradingVolume = new AverageDailyTradingVolumeLimit(item); } } } XmlNodeList depositoryReceiptNodeList = xmlNode.SelectNodes("depositoryReceipt"); if (depositoryReceiptNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in depositoryReceiptNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { depositoryReceiptIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(depositoryReceiptIDRef, ob); } else if (item.Attributes.ToString() == "href") { depositoryReceiptIDRef = item.Attributes["href"].Name; } else { depositoryReceipt = new XsdTypeBoolean(item); } } } }