public CommoditySwaption(XmlNode xmlNode) : base(xmlNode) { XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; PutCallEnum ob = PutCallEnum(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new PutCallEnum(item); } } } XmlNodeList commoditySwapNodeList = xmlNode.SelectNodes("commoditySwap"); if (commoditySwapNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in commoditySwapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commoditySwapIDRef = item.Attributes["id"].Name; CommoditySwaptionUnderlying ob = CommoditySwaptionUnderlying(); IDManager.SetID(commoditySwapIDRef, ob); } else if (item.Attributes.ToString() == "href") { commoditySwapIDRef = item.Attributes["href"].Name; } else { commoditySwap = new CommoditySwaptionUnderlying(item); } } } XmlNodeList physicalExerciseNodeList = xmlNode.SelectNodes("physicalExercise"); if (physicalExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in physicalExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalExerciseIDRef = item.Attributes["id"].Name; CommodityPhysicalExercise ob = CommodityPhysicalExercise(); IDManager.SetID(physicalExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalExerciseIDRef = item.Attributes["href"].Name; } else { physicalExercise = new CommodityPhysicalExercise(item); } } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; CommodityPremium ob = CommodityPremium(); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium = new CommodityPremium(item); } } } XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing"); if (commonPricingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in commonPricingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commonPricingIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(commonPricingIDRef, ob); } else if (item.Attributes.ToString() == "href") { commonPricingIDRef = item.Attributes["href"].Name; } else { commonPricing = new XsdTypeBoolean(item); } } } XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption"); if (marketDisruptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in marketDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketDisruptionIDRef = item.Attributes["id"].Name; CommodityMarketDisruption ob = CommodityMarketDisruption(); IDManager.SetID(marketDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketDisruptionIDRef = item.Attributes["href"].Name; } else { marketDisruption = new CommodityMarketDisruption(item); } } } XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption"); if (settlementDisruptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementDisruptionIDRef = item.Attributes["id"].Name; CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum(); IDManager.SetID(settlementDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementDisruptionIDRef = item.Attributes["href"].Name; } else { settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item); } } } XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding"); if (roundingNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in roundingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { roundingIDRef = item.Attributes["id"].Name; Rounding ob = Rounding(); IDManager.SetID(roundingIDRef, ob); } else if (item.Attributes.ToString() == "href") { roundingIDRef = item.Attributes["href"].Name; } else { rounding = new Rounding(item); } } } }
public CommoditySwaption(XmlNode xmlNode) : base(xmlNode) { XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; PutCallEnum ob = new PutCallEnum(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new PutCallEnum(optionTypeNode); } } else { optionType_ = new PutCallEnum(optionTypeNode); } } XmlNode commoditySwapNode = xmlNode.SelectSingleNode("commoditySwap"); if (commoditySwapNode != null) { if (commoditySwapNode.Attributes["href"] != null || commoditySwapNode.Attributes["id"] != null) { if (commoditySwapNode.Attributes["id"] != null) { commoditySwapIDRef_ = commoditySwapNode.Attributes["id"].Value; CommoditySwaptionUnderlying ob = new CommoditySwaptionUnderlying(commoditySwapNode); IDManager.SetID(commoditySwapIDRef_, ob); } else if (commoditySwapNode.Attributes["href"] != null) { commoditySwapIDRef_ = commoditySwapNode.Attributes["href"].Value; } else { commoditySwap_ = new CommoditySwaptionUnderlying(commoditySwapNode); } } else { commoditySwap_ = new CommoditySwaptionUnderlying(commoditySwapNode); } } XmlNode physicalExerciseNode = xmlNode.SelectSingleNode("physicalExercise"); if (physicalExerciseNode != null) { if (physicalExerciseNode.Attributes["href"] != null || physicalExerciseNode.Attributes["id"] != null) { if (physicalExerciseNode.Attributes["id"] != null) { physicalExerciseIDRef_ = physicalExerciseNode.Attributes["id"].Value; CommodityPhysicalExercise ob = new CommodityPhysicalExercise(physicalExerciseNode); IDManager.SetID(physicalExerciseIDRef_, ob); } else if (physicalExerciseNode.Attributes["href"] != null) { physicalExerciseIDRef_ = physicalExerciseNode.Attributes["href"].Value; } else { physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode); } } else { physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode); } } XmlNode premiumNode = xmlNode.SelectSingleNode("premium"); if (premiumNode != null) { if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null) { if (premiumNode.Attributes["id"] != null) { premiumIDRef_ = premiumNode.Attributes["id"].Value; CommodityPremium ob = new CommodityPremium(premiumNode); IDManager.SetID(premiumIDRef_, ob); } else if (premiumNode.Attributes["href"] != null) { premiumIDRef_ = premiumNode.Attributes["href"].Value; } else { premium_ = new CommodityPremium(premiumNode); } } else { premium_ = new CommodityPremium(premiumNode); } } XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing"); if (commonPricingNode != null) { if (commonPricingNode.Attributes["href"] != null || commonPricingNode.Attributes["id"] != null) { if (commonPricingNode.Attributes["id"] != null) { commonPricingIDRef_ = commonPricingNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(commonPricingNode); IDManager.SetID(commonPricingIDRef_, ob); } else if (commonPricingNode.Attributes["href"] != null) { commonPricingIDRef_ = commonPricingNode.Attributes["href"].Value; } else { commonPricing_ = new XsdTypeBoolean(commonPricingNode); } } else { commonPricing_ = new XsdTypeBoolean(commonPricingNode); } } XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption"); if (marketDisruptionNode != null) { if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) { if (marketDisruptionNode.Attributes["id"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value; CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode); IDManager.SetID(marketDisruptionIDRef_, ob); } else if (marketDisruptionNode.Attributes["href"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value; } else { marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode); } } else { marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode); } } XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption"); if (settlementDisruptionNode != null) { if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null) { if (settlementDisruptionNode.Attributes["id"] != null) { settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value; CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); IDManager.SetID(settlementDisruptionIDRef_, ob); } else if (settlementDisruptionNode.Attributes["href"] != null) { settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value; } else { settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); } } else { settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); } } XmlNode roundingNode = xmlNode.SelectSingleNode("rounding"); if (roundingNode != null) { if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null) { if (roundingNode.Attributes["id"] != null) { roundingIDRef_ = roundingNode.Attributes["id"].Value; Rounding ob = new Rounding(roundingNode); IDManager.SetID(roundingIDRef_, ob); } else if (roundingNode.Attributes["href"] != null) { roundingIDRef_ = roundingNode.Attributes["href"].Value; } else { rounding_ = new Rounding(roundingNode); } } else { rounding_ = new Rounding(roundingNode); } } }
public CommoditySwaption(XmlNode xmlNode) : base(xmlNode) { XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; PutCallEnum ob = PutCallEnum(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new PutCallEnum(item); } } } XmlNodeList commoditySwapNodeList = xmlNode.SelectNodes("commoditySwap"); if (commoditySwapNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in commoditySwapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commoditySwapIDRef = item.Attributes["id"].Name; CommoditySwaptionUnderlying ob = CommoditySwaptionUnderlying(); IDManager.SetID(commoditySwapIDRef, ob); } else if (item.Attributes.ToString() == "href") { commoditySwapIDRef = item.Attributes["href"].Name; } else { commoditySwap = new CommoditySwaptionUnderlying(item); } } } XmlNodeList physicalExerciseNodeList = xmlNode.SelectNodes("physicalExercise"); if (physicalExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in physicalExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalExerciseIDRef = item.Attributes["id"].Name; CommodityPhysicalExercise ob = CommodityPhysicalExercise(); IDManager.SetID(physicalExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalExerciseIDRef = item.Attributes["href"].Name; } else { physicalExercise = new CommodityPhysicalExercise(item); } } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; CommodityPremium ob = CommodityPremium(); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium = new CommodityPremium(item); } } } XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing"); if (commonPricingNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in commonPricingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { commonPricingIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(commonPricingIDRef, ob); } else if (item.Attributes.ToString() == "href") { commonPricingIDRef = item.Attributes["href"].Name; } else { commonPricing = new XsdTypeBoolean(item); } } } XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption"); if (marketDisruptionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in marketDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketDisruptionIDRef = item.Attributes["id"].Name; CommodityMarketDisruption ob = CommodityMarketDisruption(); IDManager.SetID(marketDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketDisruptionIDRef = item.Attributes["href"].Name; } else { marketDisruption = new CommodityMarketDisruption(item); } } } XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption"); if (settlementDisruptionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementDisruptionIDRef = item.Attributes["id"].Name; CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum(); IDManager.SetID(settlementDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementDisruptionIDRef = item.Attributes["href"].Name; } else { settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item); } } } XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding"); if (roundingNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in roundingNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { roundingIDRef = item.Attributes["id"].Name; Rounding ob = Rounding(); IDManager.SetID(roundingIDRef, ob); } else if (item.Attributes.ToString() == "href") { roundingIDRef = item.Attributes["href"].Name; } else { rounding = new Rounding(item); } } } }
public CommoditySwaption(XmlNode xmlNode) : base(xmlNode) { XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; PutCallEnum ob = new PutCallEnum(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new PutCallEnum(optionTypeNode); } } else { optionType_ = new PutCallEnum(optionTypeNode); } } XmlNode commoditySwapNode = xmlNode.SelectSingleNode("commoditySwap"); if (commoditySwapNode != null) { if (commoditySwapNode.Attributes["href"] != null || commoditySwapNode.Attributes["id"] != null) { if (commoditySwapNode.Attributes["id"] != null) { commoditySwapIDRef_ = commoditySwapNode.Attributes["id"].Value; CommoditySwaptionUnderlying ob = new CommoditySwaptionUnderlying(commoditySwapNode); IDManager.SetID(commoditySwapIDRef_, ob); } else if (commoditySwapNode.Attributes["href"] != null) { commoditySwapIDRef_ = commoditySwapNode.Attributes["href"].Value; } else { commoditySwap_ = new CommoditySwaptionUnderlying(commoditySwapNode); } } else { commoditySwap_ = new CommoditySwaptionUnderlying(commoditySwapNode); } } XmlNode physicalExerciseNode = xmlNode.SelectSingleNode("physicalExercise"); if (physicalExerciseNode != null) { if (physicalExerciseNode.Attributes["href"] != null || physicalExerciseNode.Attributes["id"] != null) { if (physicalExerciseNode.Attributes["id"] != null) { physicalExerciseIDRef_ = physicalExerciseNode.Attributes["id"].Value; CommodityPhysicalExercise ob = new CommodityPhysicalExercise(physicalExerciseNode); IDManager.SetID(physicalExerciseIDRef_, ob); } else if (physicalExerciseNode.Attributes["href"] != null) { physicalExerciseIDRef_ = physicalExerciseNode.Attributes["href"].Value; } else { physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode); } } else { physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode); } } XmlNode premiumNode = xmlNode.SelectSingleNode("premium"); if (premiumNode != null) { if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null) { if (premiumNode.Attributes["id"] != null) { premiumIDRef_ = premiumNode.Attributes["id"].Value; CommodityPremium ob = new CommodityPremium(premiumNode); IDManager.SetID(premiumIDRef_, ob); } else if (premiumNode.Attributes["href"] != null) { premiumIDRef_ = premiumNode.Attributes["href"].Value; } else { premium_ = new CommodityPremium(premiumNode); } } else { premium_ = new CommodityPremium(premiumNode); } } XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing"); if (commonPricingNode != null) { if (commonPricingNode.Attributes["href"] != null || commonPricingNode.Attributes["id"] != null) { if (commonPricingNode.Attributes["id"] != null) { commonPricingIDRef_ = commonPricingNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(commonPricingNode); IDManager.SetID(commonPricingIDRef_, ob); } else if (commonPricingNode.Attributes["href"] != null) { commonPricingIDRef_ = commonPricingNode.Attributes["href"].Value; } else { commonPricing_ = new XsdTypeBoolean(commonPricingNode); } } else { commonPricing_ = new XsdTypeBoolean(commonPricingNode); } } XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption"); if (marketDisruptionNode != null) { if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) { if (marketDisruptionNode.Attributes["id"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value; CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode); IDManager.SetID(marketDisruptionIDRef_, ob); } else if (marketDisruptionNode.Attributes["href"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value; } else { marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode); } } else { marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode); } } XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption"); if (settlementDisruptionNode != null) { if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null) { if (settlementDisruptionNode.Attributes["id"] != null) { settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value; CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); IDManager.SetID(settlementDisruptionIDRef_, ob); } else if (settlementDisruptionNode.Attributes["href"] != null) { settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value; } else { settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); } } else { settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode); } } XmlNode roundingNode = xmlNode.SelectSingleNode("rounding"); if (roundingNode != null) { if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null) { if (roundingNode.Attributes["id"] != null) { roundingIDRef_ = roundingNode.Attributes["id"].Value; Rounding ob = new Rounding(roundingNode); IDManager.SetID(roundingIDRef_, ob); } else if (roundingNode.Attributes["href"] != null) { roundingIDRef_ = roundingNode.Attributes["href"].Value; } else { rounding_ = new Rounding(roundingNode); } } else { rounding_ = new Rounding(roundingNode); } } }