public ReferenceObligation(XmlNode xmlNode) : base(xmlNode) { 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); } } }
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 BondOption(XmlNode xmlNode) : base(xmlNode) { XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike"); if (strikeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in strikeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeIDRef = item.Attributes["id"].Name; BondOptionStrike ob = BondOptionStrike(); IDManager.SetID(strikeIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeIDRef = item.Attributes["href"].Name; } else { strike = new BondOptionStrike(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 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); } } } }
public ReferenceObligation(XmlNode xmlNode) { 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 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 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 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 primaryObligorNodeList = xmlNode.SelectNodes("primaryObligor"); if (primaryObligorNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in primaryObligorNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { primaryObligorIDRef = item.Attributes["id"].Name; LegalEntity ob = LegalEntity(); IDManager.SetID(primaryObligorIDRef, ob); } else if (item.Attributes.ToString() == "href") { primaryObligorIDRef = item.Attributes["href"].Name; } else { primaryObligor = new LegalEntity(item); } } } XmlNodeList primaryObligorReferenceNodeList = xmlNode.SelectNodes("primaryObligorReference"); if (primaryObligorReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in primaryObligorReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { primaryObligorReferenceIDRef = item.Attributes["id"].Name; LegalEntityReference ob = LegalEntityReference(); IDManager.SetID(primaryObligorReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { primaryObligorReferenceIDRef = item.Attributes["href"].Name; } else { primaryObligorReference = new LegalEntityReference(item); } } } XmlNodeList guarantorNodeList = xmlNode.SelectNodes("guarantor"); if (guarantorNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in guarantorNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { guarantorIDRef = item.Attributes["id"].Name; LegalEntity ob = LegalEntity(); IDManager.SetID(guarantorIDRef, ob); } else if (item.Attributes.ToString() == "href") { guarantorIDRef = item.Attributes["href"].Name; } else { guarantor = new LegalEntity(item); } } } XmlNodeList guarantorReferenceNodeList = xmlNode.SelectNodes("guarantorReference"); if (guarantorReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in guarantorReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { guarantorReferenceIDRef = item.Attributes["id"].Name; LegalEntityReference ob = LegalEntityReference(); IDManager.SetID(guarantorReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { guarantorReferenceIDRef = item.Attributes["href"].Name; } else { guarantorReference = new LegalEntityReference(item); } } } }
public BondReference(XmlNode xmlNode) { 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 conditionPrecedentBondNodeList = xmlNode.SelectNodes("conditionPrecedentBond"); if (conditionPrecedentBondNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in conditionPrecedentBondNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { conditionPrecedentBondIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(conditionPrecedentBondIDRef, ob); } else if (item.Attributes.ToString() == "href") { conditionPrecedentBondIDRef = item.Attributes["href"].Name; } else { conditionPrecedentBond = new XsdTypeBoolean(item); } } } XmlNodeList discrepancyClauseNodeList = xmlNode.SelectNodes("discrepancyClause"); if (discrepancyClauseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in discrepancyClauseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discrepancyClauseIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(discrepancyClauseIDRef, ob); } else if (item.Attributes.ToString() == "href") { discrepancyClauseIDRef = item.Attributes["href"].Name; } else { discrepancyClause = new XsdTypeBoolean(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 BondOption(XmlNode xmlNode) : base(xmlNode) { XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike"); if (strikeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strikeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeIDRef = item.Attributes["id"].Name; BondOptionStrike ob = BondOptionStrike(); IDManager.SetID(strikeIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeIDRef = item.Attributes["href"].Name; } else { strike = new BondOptionStrike(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 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); } } } }
public ForwardSale(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 forwardSaleDateNodeList = xmlNode.SelectNodes("forwardSaleDate"); if (forwardSaleDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in forwardSaleDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forwardSaleDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(forwardSaleDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { forwardSaleDateIDRef = item.Attributes["href"].Name; } else { forwardSaleDate = new XsdTypeDate(item); } } } XmlNodeList settlementNodeList = xmlNode.SelectNodes("settlement"); if (settlementNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementIDRef = item.Attributes["id"].Name; Payment ob = Payment(); IDManager.SetID(settlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementIDRef = item.Attributes["href"].Name; } else { settlement = new Payment(item); } } } XmlNodeList priceNodeList = xmlNode.SelectNodes("price"); if (priceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in priceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { priceIDRef = item.Attributes["id"].Name; Price ob = Price(); IDManager.SetID(priceIDRef, ob); } else if (item.Attributes.ToString() == "href") { priceIDRef = item.Attributes["href"].Name; } else { price = new Price(item); } } } }
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 ReferenceObligation(XmlNode xmlNode) { 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 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 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 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 primaryObligorNode = xmlNode.SelectSingleNode("primaryObligor"); if (primaryObligorNode != null) { if (primaryObligorNode.Attributes["href"] != null || primaryObligorNode.Attributes["id"] != null) { if (primaryObligorNode.Attributes["id"] != null) { primaryObligorIDRef_ = primaryObligorNode.Attributes["id"].Value; LegalEntity ob = new LegalEntity(primaryObligorNode); IDManager.SetID(primaryObligorIDRef_, ob); } else if (primaryObligorNode.Attributes["href"] != null) { primaryObligorIDRef_ = primaryObligorNode.Attributes["href"].Value; } else { primaryObligor_ = new LegalEntity(primaryObligorNode); } } else { primaryObligor_ = new LegalEntity(primaryObligorNode); } } XmlNode primaryObligorReferenceNode = xmlNode.SelectSingleNode("primaryObligorReference"); if (primaryObligorReferenceNode != null) { if (primaryObligorReferenceNode.Attributes["href"] != null || primaryObligorReferenceNode.Attributes["id"] != null) { if (primaryObligorReferenceNode.Attributes["id"] != null) { primaryObligorReferenceIDRef_ = primaryObligorReferenceNode.Attributes["id"].Value; LegalEntityReference ob = new LegalEntityReference(primaryObligorReferenceNode); IDManager.SetID(primaryObligorReferenceIDRef_, ob); } else if (primaryObligorReferenceNode.Attributes["href"] != null) { primaryObligorReferenceIDRef_ = primaryObligorReferenceNode.Attributes["href"].Value; } else { primaryObligorReference_ = new LegalEntityReference(primaryObligorReferenceNode); } } else { primaryObligorReference_ = new LegalEntityReference(primaryObligorReferenceNode); } } XmlNode guarantorNode = xmlNode.SelectSingleNode("guarantor"); if (guarantorNode != null) { if (guarantorNode.Attributes["href"] != null || guarantorNode.Attributes["id"] != null) { if (guarantorNode.Attributes["id"] != null) { guarantorIDRef_ = guarantorNode.Attributes["id"].Value; LegalEntity ob = new LegalEntity(guarantorNode); IDManager.SetID(guarantorIDRef_, ob); } else if (guarantorNode.Attributes["href"] != null) { guarantorIDRef_ = guarantorNode.Attributes["href"].Value; } else { guarantor_ = new LegalEntity(guarantorNode); } } else { guarantor_ = new LegalEntity(guarantorNode); } } XmlNode guarantorReferenceNode = xmlNode.SelectSingleNode("guarantorReference"); if (guarantorReferenceNode != null) { if (guarantorReferenceNode.Attributes["href"] != null || guarantorReferenceNode.Attributes["id"] != null) { if (guarantorReferenceNode.Attributes["id"] != null) { guarantorReferenceIDRef_ = guarantorReferenceNode.Attributes["id"].Value; LegalEntityReference ob = new LegalEntityReference(guarantorReferenceNode); IDManager.SetID(guarantorReferenceIDRef_, ob); } else if (guarantorReferenceNode.Attributes["href"] != null) { guarantorReferenceIDRef_ = guarantorReferenceNode.Attributes["href"].Value; } else { guarantorReference_ = new LegalEntityReference(guarantorReferenceNode); } } else { guarantorReference_ = new LegalEntityReference(guarantorReferenceNode); } } }
public BondOption(XmlNode xmlNode) : base(xmlNode) { XmlNode strikeNode = xmlNode.SelectSingleNode("strike"); if (strikeNode != null) { if (strikeNode.Attributes["href"] != null || strikeNode.Attributes["id"] != null) { if (strikeNode.Attributes["id"] != null) { strikeIDRef_ = strikeNode.Attributes["id"].Value; BondOptionStrike ob = new BondOptionStrike(strikeNode); IDManager.SetID(strikeIDRef_, ob); } else if (strikeNode.Attributes["href"] != null) { strikeIDRef_ = strikeNode.Attributes["href"].Value; } else { strike_ = new BondOptionStrike(strikeNode); } } else { strike_ = new BondOptionStrike(strikeNode); } } 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 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); } } }
public BondReference(XmlNode xmlNode) { 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 conditionPrecedentBondNode = xmlNode.SelectSingleNode("conditionPrecedentBond"); if (conditionPrecedentBondNode != null) { if (conditionPrecedentBondNode.Attributes["href"] != null || conditionPrecedentBondNode.Attributes["id"] != null) { if (conditionPrecedentBondNode.Attributes["id"] != null) { conditionPrecedentBondIDRef_ = conditionPrecedentBondNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(conditionPrecedentBondNode); IDManager.SetID(conditionPrecedentBondIDRef_, ob); } else if (conditionPrecedentBondNode.Attributes["href"] != null) { conditionPrecedentBondIDRef_ = conditionPrecedentBondNode.Attributes["href"].Value; } else { conditionPrecedentBond_ = new XsdTypeBoolean(conditionPrecedentBondNode); } } else { conditionPrecedentBond_ = new XsdTypeBoolean(conditionPrecedentBondNode); } } XmlNode discrepancyClauseNode = xmlNode.SelectSingleNode("discrepancyClause"); if (discrepancyClauseNode != null) { if (discrepancyClauseNode.Attributes["href"] != null || discrepancyClauseNode.Attributes["id"] != null) { if (discrepancyClauseNode.Attributes["id"] != null) { discrepancyClauseIDRef_ = discrepancyClauseNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(discrepancyClauseNode); IDManager.SetID(discrepancyClauseIDRef_, ob); } else if (discrepancyClauseNode.Attributes["href"] != null) { discrepancyClauseIDRef_ = discrepancyClauseNode.Attributes["href"].Value; } else { discrepancyClause_ = new XsdTypeBoolean(discrepancyClauseNode); } } else { discrepancyClause_ = new XsdTypeBoolean(discrepancyClauseNode); } } }
public InstrumentTradeDetails(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 quantityNode = xmlNode.SelectSingleNode("quantity"); if (quantityNode != null) { if (quantityNode.Attributes["href"] != null || quantityNode.Attributes["id"] != null) { if (quantityNode.Attributes["id"] != null) { quantityIDRef_ = quantityNode.Attributes["id"].Value; InstrumentTradeQuantity ob = new InstrumentTradeQuantity(quantityNode); IDManager.SetID(quantityIDRef_, ob); } else if (quantityNode.Attributes["href"] != null) { quantityIDRef_ = quantityNode.Attributes["href"].Value; } else { quantity_ = new InstrumentTradeQuantity(quantityNode); } } else { quantity_ = new InstrumentTradeQuantity(quantityNode); } } XmlNode pricingNode = xmlNode.SelectSingleNode("pricing"); if (pricingNode != null) { if (pricingNode.Attributes["href"] != null || pricingNode.Attributes["id"] != null) { if (pricingNode.Attributes["id"] != null) { pricingIDRef_ = pricingNode.Attributes["id"].Value; InstrumentTradePricing ob = new InstrumentTradePricing(pricingNode); IDManager.SetID(pricingIDRef_, ob); } else if (pricingNode.Attributes["href"] != null) { pricingIDRef_ = pricingNode.Attributes["href"].Value; } else { pricing_ = new InstrumentTradePricing(pricingNode); } } else { pricing_ = new InstrumentTradePricing(pricingNode); } } XmlNode principalNode = xmlNode.SelectSingleNode("principal"); if (principalNode != null) { if (principalNode.Attributes["href"] != null || principalNode.Attributes["id"] != null) { if (principalNode.Attributes["id"] != null) { principalIDRef_ = principalNode.Attributes["id"].Value; InstrumentTradePrincipal ob = new InstrumentTradePrincipal(principalNode); IDManager.SetID(principalIDRef_, ob); } else if (principalNode.Attributes["href"] != null) { principalIDRef_ = principalNode.Attributes["href"].Value; } else { principal_ = new InstrumentTradePrincipal(principalNode); } } else { principal_ = new InstrumentTradePrincipal(principalNode); } } }
public BondReference(XmlNode xmlNode) { 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 conditionPrecedentBondNodeList = xmlNode.SelectNodes("conditionPrecedentBond"); if (conditionPrecedentBondNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in conditionPrecedentBondNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { conditionPrecedentBondIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(conditionPrecedentBondIDRef, ob); } else if (item.Attributes.ToString() == "href") { conditionPrecedentBondIDRef = item.Attributes["href"].Name; } else { conditionPrecedentBond = new XsdTypeBoolean(item); } } } XmlNodeList discrepancyClauseNodeList = xmlNode.SelectNodes("discrepancyClause"); if (discrepancyClauseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in discrepancyClauseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discrepancyClauseIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(discrepancyClauseIDRef, ob); } else if (item.Attributes.ToString() == "href") { discrepancyClauseIDRef = item.Attributes["href"].Name; } else { discrepancyClause = new XsdTypeBoolean(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 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 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 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 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 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 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 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 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); } } } }