public Swaption(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); } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList != null) { this.premium_ = new List <Payment>(); foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { premiumIDRef_ = item.Attributes["id"].Value; premium_.Add(new Payment(item)); IDManager.SetID(premiumIDRef_, premium_[premium_.Count - 1]); } else if (item.Attributes["href"] != null) { premiumIDRef_ = item.Attributes["href"].Value; } else { premium_.Add(new Payment(item)); } } else { premium_.Add(new Payment(item)); } } } XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure"); if (exerciseProcedureNode != null) { if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null) { if (exerciseProcedureNode.Attributes["id"] != null) { exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value; ExerciseProcedure ob = new ExerciseProcedure(exerciseProcedureNode); IDManager.SetID(exerciseProcedureIDRef_, ob); } else if (exerciseProcedureNode.Attributes["href"] != null) { exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value; } else { exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode); } } else { exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode); } } XmlNode calculationAgentNode = xmlNode.SelectSingleNode("calculationAgent"); if (calculationAgentNode != null) { if (calculationAgentNode.Attributes["href"] != null || calculationAgentNode.Attributes["id"] != null) { if (calculationAgentNode.Attributes["id"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["id"].Value; CalculationAgent ob = new CalculationAgent(calculationAgentNode); IDManager.SetID(calculationAgentIDRef_, ob); } else if (calculationAgentNode.Attributes["href"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["href"].Value; } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement"); if (cashSettlementNode != null) { if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) { if (cashSettlementNode.Attributes["id"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value; CashSettlement ob = new CashSettlement(cashSettlementNode); IDManager.SetID(cashSettlementIDRef_, ob); } else if (cashSettlementNode.Attributes["href"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value; } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } XmlNode physicalSettlementNode = xmlNode.SelectSingleNode("physicalSettlement"); if (physicalSettlementNode != null) { if (physicalSettlementNode.Attributes["href"] != null || physicalSettlementNode.Attributes["id"] != null) { if (physicalSettlementNode.Attributes["id"] != null) { physicalSettlementIDRef_ = physicalSettlementNode.Attributes["id"].Value; SwaptionPhysicalSettlement ob = new SwaptionPhysicalSettlement(physicalSettlementNode); IDManager.SetID(physicalSettlementIDRef_, ob); } else if (physicalSettlementNode.Attributes["href"] != null) { physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value; } else { physicalSettlement_ = new SwaptionPhysicalSettlement(physicalSettlementNode); } } else { physicalSettlement_ = new SwaptionPhysicalSettlement(physicalSettlementNode); } } XmlNode swaptionStraddleNode = xmlNode.SelectSingleNode("swaptionStraddle"); if (swaptionStraddleNode != null) { if (swaptionStraddleNode.Attributes["href"] != null || swaptionStraddleNode.Attributes["id"] != null) { if (swaptionStraddleNode.Attributes["id"] != null) { swaptionStraddleIDRef_ = swaptionStraddleNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(swaptionStraddleNode); IDManager.SetID(swaptionStraddleIDRef_, ob); } else if (swaptionStraddleNode.Attributes["href"] != null) { swaptionStraddleIDRef_ = swaptionStraddleNode.Attributes["href"].Value; } else { swaptionStraddle_ = new XsdTypeBoolean(swaptionStraddleNode); } } else { swaptionStraddle_ = new XsdTypeBoolean(swaptionStraddleNode); } } XmlNode swaptionAdjustedDatesNode = xmlNode.SelectSingleNode("swaptionAdjustedDates"); if (swaptionAdjustedDatesNode != null) { if (swaptionAdjustedDatesNode.Attributes["href"] != null || swaptionAdjustedDatesNode.Attributes["id"] != null) { if (swaptionAdjustedDatesNode.Attributes["id"] != null) { swaptionAdjustedDatesIDRef_ = swaptionAdjustedDatesNode.Attributes["id"].Value; SwaptionAdjustedDates ob = new SwaptionAdjustedDates(swaptionAdjustedDatesNode); IDManager.SetID(swaptionAdjustedDatesIDRef_, ob); } else if (swaptionAdjustedDatesNode.Attributes["href"] != null) { swaptionAdjustedDatesIDRef_ = swaptionAdjustedDatesNode.Attributes["href"].Value; } else { swaptionAdjustedDates_ = new SwaptionAdjustedDates(swaptionAdjustedDatesNode); } } else { swaptionAdjustedDates_ = new SwaptionAdjustedDates(swaptionAdjustedDatesNode); } } XmlNode swapNode = xmlNode.SelectSingleNode("swap"); if (swapNode != null) { if (swapNode.Attributes["href"] != null || swapNode.Attributes["id"] != null) { if (swapNode.Attributes["id"] != null) { swapIDRef_ = swapNode.Attributes["id"].Value; Swap ob = new Swap(swapNode); IDManager.SetID(swapIDRef_, ob); } else if (swapNode.Attributes["href"] != null) { swapIDRef_ = swapNode.Attributes["href"].Value; } else { swap_ = new Swap(swapNode); } } else { swap_ = new Swap(swapNode); } } }
public OptionBaseExtended(XmlNode xmlNode) : base(xmlNode) { 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; Premium ob = new Premium(premiumNode); IDManager.SetID(premiumIDRef_, ob); } else if (premiumNode.Attributes["href"] != null) { premiumIDRef_ = premiumNode.Attributes["href"].Value; } else { premium_ = new Premium(premiumNode); } } else { premium_ = new Premium(premiumNode); } } XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure"); if (exerciseProcedureNode != null) { if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null) { if (exerciseProcedureNode.Attributes["id"] != null) { exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value; ExerciseProcedure ob = new ExerciseProcedure(exerciseProcedureNode); IDManager.SetID(exerciseProcedureIDRef_, ob); } else if (exerciseProcedureNode.Attributes["href"] != null) { exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value; } else { exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode); } } else { exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode); } } XmlNode featureNode = xmlNode.SelectSingleNode("feature"); if (featureNode != null) { if (featureNode.Attributes["href"] != null || featureNode.Attributes["id"] != null) { if (featureNode.Attributes["id"] != null) { featureIDRef_ = featureNode.Attributes["id"].Value; OptionFeature ob = new OptionFeature(featureNode); IDManager.SetID(featureIDRef_, ob); } else if (featureNode.Attributes["href"] != null) { featureIDRef_ = featureNode.Attributes["href"].Value; } else { feature_ = new OptionFeature(featureNode); } } else { feature_ = new OptionFeature(featureNode); } } XmlNode notionalReferenceNode = xmlNode.SelectSingleNode("notionalReference"); if (notionalReferenceNode != null) { if (notionalReferenceNode.Attributes["href"] != null || notionalReferenceNode.Attributes["id"] != null) { if (notionalReferenceNode.Attributes["id"] != null) { notionalReferenceIDRef_ = notionalReferenceNode.Attributes["id"].Value; NotionalAmountReference ob = new NotionalAmountReference(notionalReferenceNode); IDManager.SetID(notionalReferenceIDRef_, ob); } else if (notionalReferenceNode.Attributes["href"] != null) { notionalReferenceIDRef_ = notionalReferenceNode.Attributes["href"].Value; } else { notionalReference_ = new NotionalAmountReference(notionalReferenceNode); } } else { notionalReference_ = new NotionalAmountReference(notionalReferenceNode); } } XmlNode notionalAmountNode = xmlNode.SelectSingleNode("notionalAmount"); if (notionalAmountNode != null) { if (notionalAmountNode.Attributes["href"] != null || notionalAmountNode.Attributes["id"] != null) { if (notionalAmountNode.Attributes["id"] != null) { notionalAmountIDRef_ = notionalAmountNode.Attributes["id"].Value; Money ob = new Money(notionalAmountNode); IDManager.SetID(notionalAmountIDRef_, ob); } else if (notionalAmountNode.Attributes["href"] != null) { notionalAmountIDRef_ = notionalAmountNode.Attributes["href"].Value; } else { notionalAmount_ = new Money(notionalAmountNode); } } else { notionalAmount_ = new Money(notionalAmountNode); } } XmlNode optionEntitlementNode = xmlNode.SelectSingleNode("optionEntitlement"); if (optionEntitlementNode != null) { if (optionEntitlementNode.Attributes["href"] != null || optionEntitlementNode.Attributes["id"] != null) { if (optionEntitlementNode.Attributes["id"] != null) { optionEntitlementIDRef_ = optionEntitlementNode.Attributes["id"].Value; PositiveDecimal ob = new PositiveDecimal(optionEntitlementNode); IDManager.SetID(optionEntitlementIDRef_, ob); } else if (optionEntitlementNode.Attributes["href"] != null) { optionEntitlementIDRef_ = optionEntitlementNode.Attributes["href"].Value; } else { optionEntitlement_ = new PositiveDecimal(optionEntitlementNode); } } else { optionEntitlement_ = new PositiveDecimal(optionEntitlementNode); } } XmlNode entitlementCurrencyNode = xmlNode.SelectSingleNode("entitlementCurrency"); if (entitlementCurrencyNode != null) { if (entitlementCurrencyNode.Attributes["href"] != null || entitlementCurrencyNode.Attributes["id"] != null) { if (entitlementCurrencyNode.Attributes["id"] != null) { entitlementCurrencyIDRef_ = entitlementCurrencyNode.Attributes["id"].Value; Currency ob = new Currency(entitlementCurrencyNode); IDManager.SetID(entitlementCurrencyIDRef_, ob); } else if (entitlementCurrencyNode.Attributes["href"] != null) { entitlementCurrencyIDRef_ = entitlementCurrencyNode.Attributes["href"].Value; } else { entitlementCurrency_ = new Currency(entitlementCurrencyNode); } } else { entitlementCurrency_ = new Currency(entitlementCurrencyNode); } } XmlNode numberOfOptionsNode = xmlNode.SelectSingleNode("numberOfOptions"); if (numberOfOptionsNode != null) { if (numberOfOptionsNode.Attributes["href"] != null || numberOfOptionsNode.Attributes["id"] != null) { if (numberOfOptionsNode.Attributes["id"] != null) { numberOfOptionsIDRef_ = numberOfOptionsNode.Attributes["id"].Value; PositiveDecimal ob = new PositiveDecimal(numberOfOptionsNode); IDManager.SetID(numberOfOptionsIDRef_, ob); } else if (numberOfOptionsNode.Attributes["href"] != null) { numberOfOptionsIDRef_ = numberOfOptionsNode.Attributes["href"].Value; } else { numberOfOptions_ = new PositiveDecimal(numberOfOptionsNode); } } else { numberOfOptions_ = new PositiveDecimal(numberOfOptionsNode); } } XmlNode settlementTypeNode = xmlNode.SelectSingleNode("settlementType"); if (settlementTypeNode != null) { if (settlementTypeNode.Attributes["href"] != null || settlementTypeNode.Attributes["id"] != null) { if (settlementTypeNode.Attributes["id"] != null) { settlementTypeIDRef_ = settlementTypeNode.Attributes["id"].Value; SettlementTypeEnum ob = new SettlementTypeEnum(settlementTypeNode); IDManager.SetID(settlementTypeIDRef_, ob); } else if (settlementTypeNode.Attributes["href"] != null) { settlementTypeIDRef_ = settlementTypeNode.Attributes["href"].Value; } else { settlementType_ = new SettlementTypeEnum(settlementTypeNode); } } else { settlementType_ = new SettlementTypeEnum(settlementTypeNode); } } XmlNode settlementDateNode = xmlNode.SelectSingleNode("settlementDate"); if (settlementDateNode != null) { if (settlementDateNode.Attributes["href"] != null || settlementDateNode.Attributes["id"] != null) { if (settlementDateNode.Attributes["id"] != null) { settlementDateIDRef_ = settlementDateNode.Attributes["id"].Value; AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(settlementDateNode); IDManager.SetID(settlementDateIDRef_, ob); } else if (settlementDateNode.Attributes["href"] != null) { settlementDateIDRef_ = settlementDateNode.Attributes["href"].Value; } else { settlementDate_ = new AdjustableOrRelativeDate(settlementDateNode); } } else { settlementDate_ = new AdjustableOrRelativeDate(settlementDateNode); } } XmlNode settlementAmountNode = xmlNode.SelectSingleNode("settlementAmount"); if (settlementAmountNode != null) { if (settlementAmountNode.Attributes["href"] != null || settlementAmountNode.Attributes["id"] != null) { if (settlementAmountNode.Attributes["id"] != null) { settlementAmountIDRef_ = settlementAmountNode.Attributes["id"].Value; Money ob = new Money(settlementAmountNode); IDManager.SetID(settlementAmountIDRef_, ob); } else if (settlementAmountNode.Attributes["href"] != null) { settlementAmountIDRef_ = settlementAmountNode.Attributes["href"].Value; } else { settlementAmount_ = new Money(settlementAmountNode); } } else { settlementAmount_ = new Money(settlementAmountNode); } } XmlNode settlementCurrencyNode = xmlNode.SelectSingleNode("settlementCurrency"); if (settlementCurrencyNode != null) { if (settlementCurrencyNode.Attributes["href"] != null || settlementCurrencyNode.Attributes["id"] != null) { if (settlementCurrencyNode.Attributes["id"] != null) { settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["id"].Value; Currency ob = new Currency(settlementCurrencyNode); IDManager.SetID(settlementCurrencyIDRef_, ob); } else if (settlementCurrencyNode.Attributes["href"] != null) { settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["href"].Value; } else { settlementCurrency_ = new Currency(settlementCurrencyNode); } } else { settlementCurrency_ = new Currency(settlementCurrencyNode); } } }
public CancelableProvision(XmlNode 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 exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); if (exerciseNoticeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef = item.Attributes["id"].Name; ExerciseNotice ob = ExerciseNotice(); IDManager.SetID(exerciseNoticeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseNoticeIDRef = item.Attributes["href"].Name; } else { exerciseNotice = new ExerciseNotice(item); } } } XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation"); if (followUpConfirmationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in followUpConfirmationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { followUpConfirmationIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(followUpConfirmationIDRef, ob); } else if (item.Attributes.ToString() == "href") { followUpConfirmationIDRef = item.Attributes["href"].Name; } else { followUpConfirmation = new XsdTypeBoolean(item); } } } XmlNodeList cancelableProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("cancelableProvisionAdjustedDates"); if (cancelableProvisionAdjustedDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cancelableProvisionAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cancelableProvisionAdjustedDatesIDRef = item.Attributes["id"].Name; CancelableProvisionAdjustedDates ob = CancelableProvisionAdjustedDates(); IDManager.SetID(cancelableProvisionAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { cancelableProvisionAdjustedDatesIDRef = item.Attributes["href"].Name; } else { cancelableProvisionAdjustedDates = new CancelableProvisionAdjustedDates(item); } } } XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment"); foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["id"].Name; List<FinalCalculationPeriodDateAdjustment> ob = new List<FinalCalculationPeriodDateAdjustment>(); ob.Add(new FinalCalculationPeriodDateAdjustment(item)); IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef, ob); } else if (item.Attributes.ToString() == "href") { finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["href"].Name; } else { finalCalculationPeriodDateAdjustment.Add(new FinalCalculationPeriodDateAdjustment(item)); } } } XmlNodeList initialFeeNodeList = xmlNode.SelectNodes("initialFee"); if (initialFeeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in initialFeeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { initialFeeIDRef = item.Attributes["id"].Name; SimplePayment ob = SimplePayment(); IDManager.SetID(initialFeeIDRef, ob); } else if (item.Attributes.ToString() == "href") { initialFeeIDRef = item.Attributes["href"].Name; } else { initialFee = new SimplePayment(item); } } } }
public ExtendibleProvision(XmlNode 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 exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); if (exerciseNoticeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef = item.Attributes["id"].Name; ExerciseNotice ob = ExerciseNotice(); IDManager.SetID(exerciseNoticeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseNoticeIDRef = item.Attributes["href"].Name; } else { exerciseNotice = new ExerciseNotice(item); } } } XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation"); if (followUpConfirmationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in followUpConfirmationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { followUpConfirmationIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(followUpConfirmationIDRef, ob); } else if (item.Attributes.ToString() == "href") { followUpConfirmationIDRef = item.Attributes["href"].Name; } else { followUpConfirmation = new XsdTypeBoolean(item); } } } XmlNodeList extendibleProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("extendibleProvisionAdjustedDates"); if (extendibleProvisionAdjustedDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in extendibleProvisionAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { extendibleProvisionAdjustedDatesIDRef = item.Attributes["id"].Name; ExtendibleProvisionAdjustedDates ob = ExtendibleProvisionAdjustedDates(); IDManager.SetID(extendibleProvisionAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { extendibleProvisionAdjustedDatesIDRef = item.Attributes["href"].Name; } else { extendibleProvisionAdjustedDates = new ExtendibleProvisionAdjustedDates(item); } } } }
public ExtendibleProvision(XmlNode 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 exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); if (exerciseNoticeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef = item.Attributes["id"].Name; ExerciseNotice ob = ExerciseNotice(); IDManager.SetID(exerciseNoticeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseNoticeIDRef = item.Attributes["href"].Name; } else { exerciseNotice = new ExerciseNotice(item); } } } XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation"); if (followUpConfirmationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in followUpConfirmationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { followUpConfirmationIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(followUpConfirmationIDRef, ob); } else if (item.Attributes.ToString() == "href") { followUpConfirmationIDRef = item.Attributes["href"].Name; } else { followUpConfirmation = new XsdTypeBoolean(item); } } } XmlNodeList extendibleProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("extendibleProvisionAdjustedDates"); if (extendibleProvisionAdjustedDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in extendibleProvisionAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { extendibleProvisionAdjustedDatesIDRef = item.Attributes["id"].Name; ExtendibleProvisionAdjustedDates ob = ExtendibleProvisionAdjustedDates(); IDManager.SetID(extendibleProvisionAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { extendibleProvisionAdjustedDatesIDRef = item.Attributes["href"].Name; } else { extendibleProvisionAdjustedDates = new ExtendibleProvisionAdjustedDates(item); } } } }
public CancelableProvision(XmlNode 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 exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); if (exerciseNoticeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef = item.Attributes["id"].Name; ExerciseNotice ob = ExerciseNotice(); IDManager.SetID(exerciseNoticeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseNoticeIDRef = item.Attributes["href"].Name; } else { exerciseNotice = new ExerciseNotice(item); } } } XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation"); if (followUpConfirmationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in followUpConfirmationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { followUpConfirmationIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(followUpConfirmationIDRef, ob); } else if (item.Attributes.ToString() == "href") { followUpConfirmationIDRef = item.Attributes["href"].Name; } else { followUpConfirmation = new XsdTypeBoolean(item); } } } XmlNodeList cancelableProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("cancelableProvisionAdjustedDates"); if (cancelableProvisionAdjustedDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in cancelableProvisionAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cancelableProvisionAdjustedDatesIDRef = item.Attributes["id"].Name; CancelableProvisionAdjustedDates ob = CancelableProvisionAdjustedDates(); IDManager.SetID(cancelableProvisionAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { cancelableProvisionAdjustedDatesIDRef = item.Attributes["href"].Name; } else { cancelableProvisionAdjustedDates = new CancelableProvisionAdjustedDates(item); } } } XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment"); foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["id"].Name; List <FinalCalculationPeriodDateAdjustment> ob = new List <FinalCalculationPeriodDateAdjustment>(); ob.Add(new FinalCalculationPeriodDateAdjustment(item)); IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef, ob); } else if (item.Attributes.ToString() == "href") { finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["href"].Name; } else { finalCalculationPeriodDateAdjustment.Add(new FinalCalculationPeriodDateAdjustment(item)); } } } XmlNodeList initialFeeNodeList = xmlNode.SelectNodes("initialFee"); if (initialFeeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in initialFeeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { initialFeeIDRef = item.Attributes["id"].Name; SimplePayment ob = SimplePayment(); IDManager.SetID(initialFeeIDRef, ob); } else if (item.Attributes.ToString() == "href") { initialFeeIDRef = item.Attributes["href"].Name; } else { initialFee = new SimplePayment(item); } } } }
public OptionalEarlyTermination(XmlNode xmlNode) { XmlNodeList singlePartyOptionNodeList = xmlNode.SelectNodes("singlePartyOption"); if (singlePartyOptionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in singlePartyOptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { singlePartyOptionIDRef = item.Attributes["id"].Name; SinglePartyOption ob = SinglePartyOption(); IDManager.SetID(singlePartyOptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { singlePartyOptionIDRef = item.Attributes["href"].Name; } else { singlePartyOption = new SinglePartyOption(item); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef = item.Attributes["id"].Name; List <ExerciseNotice> ob = new List <ExerciseNotice>(); ob.Add(new ExerciseNotice(item)); IDManager.SetID(exerciseNoticeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseNoticeIDRef = item.Attributes["href"].Name; } else { exerciseNotice.Add(new ExerciseNotice(item)); } } } XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation"); if (followUpConfirmationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in followUpConfirmationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { followUpConfirmationIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(followUpConfirmationIDRef, ob); } else if (item.Attributes.ToString() == "href") { followUpConfirmationIDRef = item.Attributes["href"].Name; } else { followUpConfirmation = new XsdTypeBoolean(item); } } } XmlNodeList calculationAgentNodeList = xmlNode.SelectNodes("calculationAgent"); if (calculationAgentNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationAgentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationAgentIDRef = item.Attributes["id"].Name; CalculationAgent ob = CalculationAgent(); IDManager.SetID(calculationAgentIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationAgentIDRef = item.Attributes["href"].Name; } else { calculationAgent = new CalculationAgent(item); } } } XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement"); if (cashSettlementNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in cashSettlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashSettlementIDRef = item.Attributes["id"].Name; CashSettlement ob = CashSettlement(); IDManager.SetID(cashSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementIDRef = item.Attributes["href"].Name; } else { cashSettlement = new CashSettlement(item); } } } XmlNodeList optionalEarlyTerminationAdjustedDatesNodeList = xmlNode.SelectNodes("optionalEarlyTerminationAdjustedDates"); if (optionalEarlyTerminationAdjustedDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionalEarlyTerminationAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["id"].Name; OptionalEarlyTerminationAdjustedDates ob = OptionalEarlyTerminationAdjustedDates(); IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["href"].Name; } else { optionalEarlyTerminationAdjustedDates = new OptionalEarlyTerminationAdjustedDates(item); } } } }
public Swaption(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 premiumNodeList = xmlNode.SelectNodes("premium"); foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; List<Payment> ob = new List<Payment>(); ob.Add(new Payment(item)); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium.Add(new Payment(item)); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure"); if (exerciseProcedureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseProcedureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseProcedureIDRef = item.Attributes["id"].Name; ExerciseProcedure ob = ExerciseProcedure(); IDManager.SetID(exerciseProcedureIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseProcedureIDRef = item.Attributes["href"].Name; } else { exerciseProcedure = new ExerciseProcedure(item); } } } XmlNodeList calculationAgentNodeList = xmlNode.SelectNodes("calculationAgent"); if (calculationAgentNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationAgentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationAgentIDRef = item.Attributes["id"].Name; CalculationAgent ob = CalculationAgent(); IDManager.SetID(calculationAgentIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationAgentIDRef = item.Attributes["href"].Name; } else { calculationAgent = new CalculationAgent(item); } } } XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement"); if (cashSettlementNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cashSettlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashSettlementIDRef = item.Attributes["id"].Name; CashSettlement ob = CashSettlement(); IDManager.SetID(cashSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementIDRef = item.Attributes["href"].Name; } else { cashSettlement = new CashSettlement(item); } } } XmlNodeList physicalSettlementNodeList = xmlNode.SelectNodes("physicalSettlement"); if (physicalSettlementNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in physicalSettlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalSettlementIDRef = item.Attributes["id"].Name; SwaptionPhysicalSettlement ob = SwaptionPhysicalSettlement(); IDManager.SetID(physicalSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalSettlementIDRef = item.Attributes["href"].Name; } else { physicalSettlement = new SwaptionPhysicalSettlement(item); } } } XmlNodeList swaptionStraddleNodeList = xmlNode.SelectNodes("swaptionStraddle"); if (swaptionStraddleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in swaptionStraddleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swaptionStraddleIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(swaptionStraddleIDRef, ob); } else if (item.Attributes.ToString() == "href") { swaptionStraddleIDRef = item.Attributes["href"].Name; } else { swaptionStraddle = new XsdTypeBoolean(item); } } } XmlNodeList swaptionAdjustedDatesNodeList = xmlNode.SelectNodes("swaptionAdjustedDates"); if (swaptionAdjustedDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in swaptionAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swaptionAdjustedDatesIDRef = item.Attributes["id"].Name; SwaptionAdjustedDates ob = SwaptionAdjustedDates(); IDManager.SetID(swaptionAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { swaptionAdjustedDatesIDRef = item.Attributes["href"].Name; } else { swaptionAdjustedDates = new SwaptionAdjustedDates(item); } } } XmlNodeList swapNodeList = xmlNode.SelectNodes("swap"); if (swapNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in swapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swapIDRef = item.Attributes["id"].Name; Swap ob = Swap(); IDManager.SetID(swapIDRef, ob); } else if (item.Attributes.ToString() == "href") { swapIDRef = item.Attributes["href"].Name; } else { swap = new Swap(item); } } } }
public ExtendibleProvision(XmlNode 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 exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice"); if (exerciseNoticeNode != null) { if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null) { if (exerciseNoticeNode.Attributes["id"] != null) { exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value; ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode); IDManager.SetID(exerciseNoticeIDRef_, ob); } else if (exerciseNoticeNode.Attributes["href"] != null) { exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value; } else { exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode); } } else { exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode); } } XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation"); if (followUpConfirmationNode != null) { if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) { if (followUpConfirmationNode.Attributes["id"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode); IDManager.SetID(followUpConfirmationIDRef_, ob); } else if (followUpConfirmationNode.Attributes["href"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value; } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } XmlNode extendibleProvisionAdjustedDatesNode = xmlNode.SelectSingleNode("extendibleProvisionAdjustedDates"); if (extendibleProvisionAdjustedDatesNode != null) { if (extendibleProvisionAdjustedDatesNode.Attributes["href"] != null || extendibleProvisionAdjustedDatesNode.Attributes["id"] != null) { if (extendibleProvisionAdjustedDatesNode.Attributes["id"] != null) { extendibleProvisionAdjustedDatesIDRef_ = extendibleProvisionAdjustedDatesNode.Attributes["id"].Value; ExtendibleProvisionAdjustedDates ob = new ExtendibleProvisionAdjustedDates(extendibleProvisionAdjustedDatesNode); IDManager.SetID(extendibleProvisionAdjustedDatesIDRef_, ob); } else if (extendibleProvisionAdjustedDatesNode.Attributes["href"] != null) { extendibleProvisionAdjustedDatesIDRef_ = extendibleProvisionAdjustedDatesNode.Attributes["href"].Value; } else { extendibleProvisionAdjustedDates_ = new ExtendibleProvisionAdjustedDates(extendibleProvisionAdjustedDatesNode); } } else { extendibleProvisionAdjustedDates_ = new ExtendibleProvisionAdjustedDates(extendibleProvisionAdjustedDatesNode); } } }
public Swaption(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 premiumNodeList = xmlNode.SelectNodes("premium"); foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; List <Payment> ob = new List <Payment>(); ob.Add(new Payment(item)); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium.Add(new Payment(item)); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure"); if (exerciseProcedureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseProcedureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseProcedureIDRef = item.Attributes["id"].Name; ExerciseProcedure ob = ExerciseProcedure(); IDManager.SetID(exerciseProcedureIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseProcedureIDRef = item.Attributes["href"].Name; } else { exerciseProcedure = new ExerciseProcedure(item); } } } XmlNodeList calculationAgentNodeList = xmlNode.SelectNodes("calculationAgent"); if (calculationAgentNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationAgentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationAgentIDRef = item.Attributes["id"].Name; CalculationAgent ob = CalculationAgent(); IDManager.SetID(calculationAgentIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationAgentIDRef = item.Attributes["href"].Name; } else { calculationAgent = new CalculationAgent(item); } } } XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement"); if (cashSettlementNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in cashSettlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashSettlementIDRef = item.Attributes["id"].Name; CashSettlement ob = CashSettlement(); IDManager.SetID(cashSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementIDRef = item.Attributes["href"].Name; } else { cashSettlement = new CashSettlement(item); } } } XmlNodeList physicalSettlementNodeList = xmlNode.SelectNodes("physicalSettlement"); if (physicalSettlementNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in physicalSettlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalSettlementIDRef = item.Attributes["id"].Name; SwaptionPhysicalSettlement ob = SwaptionPhysicalSettlement(); IDManager.SetID(physicalSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalSettlementIDRef = item.Attributes["href"].Name; } else { physicalSettlement = new SwaptionPhysicalSettlement(item); } } } XmlNodeList swaptionStraddleNodeList = xmlNode.SelectNodes("swaptionStraddle"); if (swaptionStraddleNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in swaptionStraddleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swaptionStraddleIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(swaptionStraddleIDRef, ob); } else if (item.Attributes.ToString() == "href") { swaptionStraddleIDRef = item.Attributes["href"].Name; } else { swaptionStraddle = new XsdTypeBoolean(item); } } } XmlNodeList swaptionAdjustedDatesNodeList = xmlNode.SelectNodes("swaptionAdjustedDates"); if (swaptionAdjustedDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in swaptionAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swaptionAdjustedDatesIDRef = item.Attributes["id"].Name; SwaptionAdjustedDates ob = SwaptionAdjustedDates(); IDManager.SetID(swaptionAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { swaptionAdjustedDatesIDRef = item.Attributes["href"].Name; } else { swaptionAdjustedDates = new SwaptionAdjustedDates(item); } } } XmlNodeList swapNodeList = xmlNode.SelectNodes("swap"); if (swapNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in swapNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swapIDRef = item.Attributes["id"].Name; Swap ob = Swap(); IDManager.SetID(swapIDRef, ob); } else if (item.Attributes.ToString() == "href") { swapIDRef = item.Attributes["href"].Name; } else { swap = new Swap(item); } } } }
public CancelableProvision(XmlNode 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 exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice"); if (exerciseNoticeNode != null) { if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null) { if (exerciseNoticeNode.Attributes["id"] != null) { exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value; ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode); IDManager.SetID(exerciseNoticeIDRef_, ob); } else if (exerciseNoticeNode.Attributes["href"] != null) { exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value; } else { exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode); } } else { exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode); } } XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation"); if (followUpConfirmationNode != null) { if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) { if (followUpConfirmationNode.Attributes["id"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode); IDManager.SetID(followUpConfirmationIDRef_, ob); } else if (followUpConfirmationNode.Attributes["href"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value; } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } XmlNode cancelableProvisionAdjustedDatesNode = xmlNode.SelectSingleNode("cancelableProvisionAdjustedDates"); if (cancelableProvisionAdjustedDatesNode != null) { if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null || cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) { if (cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) { cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["id"].Value; CancelableProvisionAdjustedDates ob = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode); IDManager.SetID(cancelableProvisionAdjustedDatesIDRef_, ob); } else if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null) { cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["href"].Value; } else { cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode); } } else { cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode); } } XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment"); if (finalCalculationPeriodDateAdjustmentNodeList != null) { this.finalCalculationPeriodDateAdjustment_ = new List <FinalCalculationPeriodDateAdjustment>(); foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["id"].Value; finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item)); IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef_, finalCalculationPeriodDateAdjustment_[finalCalculationPeriodDateAdjustment_.Count - 1]); } else if (item.Attributes["href"] != null) { finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["href"].Value; } else { finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item)); } } else { finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item)); } } } XmlNode initialFeeNode = xmlNode.SelectSingleNode("initialFee"); if (initialFeeNode != null) { if (initialFeeNode.Attributes["href"] != null || initialFeeNode.Attributes["id"] != null) { if (initialFeeNode.Attributes["id"] != null) { initialFeeIDRef_ = initialFeeNode.Attributes["id"].Value; SimplePayment ob = new SimplePayment(initialFeeNode); IDManager.SetID(initialFeeIDRef_, ob); } else if (initialFeeNode.Attributes["href"] != null) { initialFeeIDRef_ = initialFeeNode.Attributes["href"].Value; } else { initialFee_ = new SimplePayment(initialFeeNode); } } else { initialFee_ = new SimplePayment(initialFeeNode); } } }
public OptionBaseExtended(XmlNode xmlNode) : base(xmlNode) { 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; Premium ob = Premium(); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium = new Premium(item); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure"); if (exerciseProcedureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseProcedureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseProcedureIDRef = item.Attributes["id"].Name; ExerciseProcedure ob = ExerciseProcedure(); IDManager.SetID(exerciseProcedureIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseProcedureIDRef = item.Attributes["href"].Name; } else { exerciseProcedure = new ExerciseProcedure(item); } } } XmlNodeList featureNodeList = xmlNode.SelectNodes("feature"); if (featureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in featureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { featureIDRef = item.Attributes["id"].Name; OptionFeature ob = OptionFeature(); IDManager.SetID(featureIDRef, ob); } else if (item.Attributes.ToString() == "href") { featureIDRef = item.Attributes["href"].Name; } else { feature = new OptionFeature(item); } } } XmlNodeList notionalReferenceNodeList = xmlNode.SelectNodes("notionalReference"); if (notionalReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalReferenceIDRef = item.Attributes["id"].Name; NotionalAmountReference ob = NotionalAmountReference(); IDManager.SetID(notionalReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalReferenceIDRef = item.Attributes["href"].Name; } else { notionalReference = new NotionalAmountReference(item); } } } XmlNodeList notionalAmountNodeList = xmlNode.SelectNodes("notionalAmount"); if (notionalAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(notionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalAmountIDRef = item.Attributes["href"].Name; } else { notionalAmount = new Money(item); } } } XmlNodeList optionEntitlementNodeList = xmlNode.SelectNodes("optionEntitlement"); if (optionEntitlementNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in optionEntitlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionEntitlementIDRef = item.Attributes["id"].Name; PositiveDecimal ob = PositiveDecimal(); IDManager.SetID(optionEntitlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionEntitlementIDRef = item.Attributes["href"].Name; } else { optionEntitlement = new PositiveDecimal(item); } } } XmlNodeList entitlementCurrencyNodeList = xmlNode.SelectNodes("entitlementCurrency"); if (entitlementCurrencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in entitlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { entitlementCurrencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(entitlementCurrencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { entitlementCurrencyIDRef = item.Attributes["href"].Name; } else { entitlementCurrency = new Currency(item); } } } XmlNodeList numberOfOptionsNodeList = xmlNode.SelectNodes("numberOfOptions"); if (numberOfOptionsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in numberOfOptionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { numberOfOptionsIDRef = item.Attributes["id"].Name; PositiveDecimal ob = PositiveDecimal(); IDManager.SetID(numberOfOptionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { numberOfOptionsIDRef = item.Attributes["href"].Name; } else { numberOfOptions = new PositiveDecimal(item); } } } XmlNodeList settlementTypeNodeList = xmlNode.SelectNodes("settlementType"); if (settlementTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementTypeIDRef = item.Attributes["id"].Name; SettlementTypeEnum ob = SettlementTypeEnum(); IDManager.SetID(settlementTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementTypeIDRef = item.Attributes["href"].Name; } else { settlementType = new SettlementTypeEnum(item); } } } XmlNodeList settlementDateNodeList = xmlNode.SelectNodes("settlementDate"); if (settlementDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementDateIDRef = item.Attributes["id"].Name; AdjustableOrRelativeDate ob = AdjustableOrRelativeDate(); IDManager.SetID(settlementDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementDateIDRef = item.Attributes["href"].Name; } else { settlementDate = new AdjustableOrRelativeDate(item); } } } XmlNodeList settlementAmountNodeList = xmlNode.SelectNodes("settlementAmount"); if (settlementAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(settlementAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementAmountIDRef = item.Attributes["href"].Name; } else { settlementAmount = new Money(item); } } } XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency"); if (settlementCurrencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementCurrencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(settlementCurrencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementCurrencyIDRef = item.Attributes["href"].Name; } else { settlementCurrency = new Currency(item); } } } }
public OptionalEarlyTermination(XmlNode xmlNode) { XmlNode singlePartyOptionNode = xmlNode.SelectSingleNode("singlePartyOption"); if (singlePartyOptionNode != null) { if (singlePartyOptionNode.Attributes["href"] != null || singlePartyOptionNode.Attributes["id"] != null) { if (singlePartyOptionNode.Attributes["id"] != null) { singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["id"].Value; SinglePartyOption ob = new SinglePartyOption(singlePartyOptionNode); IDManager.SetID(singlePartyOptionIDRef_, ob); } else if (singlePartyOptionNode.Attributes["href"] != null) { singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["href"].Value; } else { singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode); } } else { singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode); } } XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); if (exerciseNoticeNodeList != null) { this.exerciseNotice_ = new List<ExerciseNotice>(); foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef_ = item.Attributes["id"].Value; exerciseNotice_.Add(new ExerciseNotice(item)); IDManager.SetID(exerciseNoticeIDRef_, exerciseNotice_[exerciseNotice_.Count - 1 ]); } else if (item.Attributes["href"] != null) { exerciseNoticeIDRef_ = item.Attributes["href"].Value; } else { exerciseNotice_.Add(new ExerciseNotice(item)); } } else { exerciseNotice_.Add(new ExerciseNotice(item)); } } } XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation"); if (followUpConfirmationNode != null) { if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) { if (followUpConfirmationNode.Attributes["id"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode); IDManager.SetID(followUpConfirmationIDRef_, ob); } else if (followUpConfirmationNode.Attributes["href"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value; } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } XmlNode calculationAgentNode = xmlNode.SelectSingleNode("calculationAgent"); if (calculationAgentNode != null) { if (calculationAgentNode.Attributes["href"] != null || calculationAgentNode.Attributes["id"] != null) { if (calculationAgentNode.Attributes["id"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["id"].Value; CalculationAgent ob = new CalculationAgent(calculationAgentNode); IDManager.SetID(calculationAgentIDRef_, ob); } else if (calculationAgentNode.Attributes["href"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["href"].Value; } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement"); if (cashSettlementNode != null) { if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) { if (cashSettlementNode.Attributes["id"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value; CashSettlement ob = new CashSettlement(cashSettlementNode); IDManager.SetID(cashSettlementIDRef_, ob); } else if (cashSettlementNode.Attributes["href"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value; } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } XmlNode optionalEarlyTerminationAdjustedDatesNode = xmlNode.SelectSingleNode("optionalEarlyTerminationAdjustedDates"); if (optionalEarlyTerminationAdjustedDatesNode != null) { if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null || optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null) { if (optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null) { optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["id"].Value; OptionalEarlyTerminationAdjustedDates ob = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode); IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef_, ob); } else if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null) { optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["href"].Value; } else { optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode); } } else { optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode); } } }
public OptionalEarlyTermination(XmlNode xmlNode) { XmlNodeList singlePartyOptionNodeList = xmlNode.SelectNodes("singlePartyOption"); if (singlePartyOptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in singlePartyOptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { singlePartyOptionIDRef = item.Attributes["id"].Name; SinglePartyOption ob = SinglePartyOption(); IDManager.SetID(singlePartyOptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { singlePartyOptionIDRef = item.Attributes["href"].Name; } else { singlePartyOption = new SinglePartyOption(item); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef = item.Attributes["id"].Name; List<ExerciseNotice> ob = new List<ExerciseNotice>(); ob.Add(new ExerciseNotice(item)); IDManager.SetID(exerciseNoticeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseNoticeIDRef = item.Attributes["href"].Name; } else { exerciseNotice.Add(new ExerciseNotice(item)); } } } XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation"); if (followUpConfirmationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in followUpConfirmationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { followUpConfirmationIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(followUpConfirmationIDRef, ob); } else if (item.Attributes.ToString() == "href") { followUpConfirmationIDRef = item.Attributes["href"].Name; } else { followUpConfirmation = new XsdTypeBoolean(item); } } } XmlNodeList calculationAgentNodeList = xmlNode.SelectNodes("calculationAgent"); if (calculationAgentNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationAgentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationAgentIDRef = item.Attributes["id"].Name; CalculationAgent ob = CalculationAgent(); IDManager.SetID(calculationAgentIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationAgentIDRef = item.Attributes["href"].Name; } else { calculationAgent = new CalculationAgent(item); } } } XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement"); if (cashSettlementNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cashSettlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashSettlementIDRef = item.Attributes["id"].Name; CashSettlement ob = CashSettlement(); IDManager.SetID(cashSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementIDRef = item.Attributes["href"].Name; } else { cashSettlement = new CashSettlement(item); } } } XmlNodeList optionalEarlyTerminationAdjustedDatesNodeList = xmlNode.SelectNodes("optionalEarlyTerminationAdjustedDates"); if (optionalEarlyTerminationAdjustedDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in optionalEarlyTerminationAdjustedDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["id"].Name; OptionalEarlyTerminationAdjustedDates ob = OptionalEarlyTerminationAdjustedDates(); IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["href"].Name; } else { optionalEarlyTerminationAdjustedDates = new OptionalEarlyTerminationAdjustedDates(item); } } } }
public CancelableProvision(XmlNode 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 exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice"); if (exerciseNoticeNode != null) { if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null) { if (exerciseNoticeNode.Attributes["id"] != null) { exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value; ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode); IDManager.SetID(exerciseNoticeIDRef_, ob); } else if (exerciseNoticeNode.Attributes["href"] != null) { exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value; } else { exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode); } } else { exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode); } } XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation"); if (followUpConfirmationNode != null) { if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) { if (followUpConfirmationNode.Attributes["id"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode); IDManager.SetID(followUpConfirmationIDRef_, ob); } else if (followUpConfirmationNode.Attributes["href"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value; } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } XmlNode cancelableProvisionAdjustedDatesNode = xmlNode.SelectSingleNode("cancelableProvisionAdjustedDates"); if (cancelableProvisionAdjustedDatesNode != null) { if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null || cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) { if (cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) { cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["id"].Value; CancelableProvisionAdjustedDates ob = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode); IDManager.SetID(cancelableProvisionAdjustedDatesIDRef_, ob); } else if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null) { cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["href"].Value; } else { cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode); } } else { cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode); } } XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment"); if (finalCalculationPeriodDateAdjustmentNodeList != null) { this.finalCalculationPeriodDateAdjustment_ = new List<FinalCalculationPeriodDateAdjustment>(); foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["id"].Value; finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item)); IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef_, finalCalculationPeriodDateAdjustment_[finalCalculationPeriodDateAdjustment_.Count - 1 ]); } else if (item.Attributes["href"] != null) { finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["href"].Value; } else { finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item)); } } else { finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item)); } } } XmlNode initialFeeNode = xmlNode.SelectSingleNode("initialFee"); if (initialFeeNode != null) { if (initialFeeNode.Attributes["href"] != null || initialFeeNode.Attributes["id"] != null) { if (initialFeeNode.Attributes["id"] != null) { initialFeeIDRef_ = initialFeeNode.Attributes["id"].Value; SimplePayment ob = new SimplePayment(initialFeeNode); IDManager.SetID(initialFeeIDRef_, ob); } else if (initialFeeNode.Attributes["href"] != null) { initialFeeIDRef_ = initialFeeNode.Attributes["href"].Value; } else { initialFee_ = new SimplePayment(initialFeeNode); } } else { initialFee_ = new SimplePayment(initialFeeNode); } } }
public OptionalEarlyTermination(XmlNode xmlNode) { XmlNode singlePartyOptionNode = xmlNode.SelectSingleNode("singlePartyOption"); if (singlePartyOptionNode != null) { if (singlePartyOptionNode.Attributes["href"] != null || singlePartyOptionNode.Attributes["id"] != null) { if (singlePartyOptionNode.Attributes["id"] != null) { singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["id"].Value; SinglePartyOption ob = new SinglePartyOption(singlePartyOptionNode); IDManager.SetID(singlePartyOptionIDRef_, ob); } else if (singlePartyOptionNode.Attributes["href"] != null) { singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["href"].Value; } else { singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode); } } else { singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode); } } XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice"); if (exerciseNoticeNodeList != null) { this.exerciseNotice_ = new List <ExerciseNotice>(); foreach (XmlNode item in exerciseNoticeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { exerciseNoticeIDRef_ = item.Attributes["id"].Value; exerciseNotice_.Add(new ExerciseNotice(item)); IDManager.SetID(exerciseNoticeIDRef_, exerciseNotice_[exerciseNotice_.Count - 1]); } else if (item.Attributes["href"] != null) { exerciseNoticeIDRef_ = item.Attributes["href"].Value; } else { exerciseNotice_.Add(new ExerciseNotice(item)); } } else { exerciseNotice_.Add(new ExerciseNotice(item)); } } } XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation"); if (followUpConfirmationNode != null) { if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) { if (followUpConfirmationNode.Attributes["id"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode); IDManager.SetID(followUpConfirmationIDRef_, ob); } else if (followUpConfirmationNode.Attributes["href"] != null) { followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value; } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } else { followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode); } } XmlNode calculationAgentNode = xmlNode.SelectSingleNode("calculationAgent"); if (calculationAgentNode != null) { if (calculationAgentNode.Attributes["href"] != null || calculationAgentNode.Attributes["id"] != null) { if (calculationAgentNode.Attributes["id"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["id"].Value; CalculationAgent ob = new CalculationAgent(calculationAgentNode); IDManager.SetID(calculationAgentIDRef_, ob); } else if (calculationAgentNode.Attributes["href"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["href"].Value; } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement"); if (cashSettlementNode != null) { if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) { if (cashSettlementNode.Attributes["id"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value; CashSettlement ob = new CashSettlement(cashSettlementNode); IDManager.SetID(cashSettlementIDRef_, ob); } else if (cashSettlementNode.Attributes["href"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value; } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } XmlNode optionalEarlyTerminationAdjustedDatesNode = xmlNode.SelectSingleNode("optionalEarlyTerminationAdjustedDates"); if (optionalEarlyTerminationAdjustedDatesNode != null) { if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null || optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null) { if (optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null) { optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["id"].Value; OptionalEarlyTerminationAdjustedDates ob = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode); IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef_, ob); } else if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null) { optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["href"].Value; } else { optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode); } } else { optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode); } } }
public OptionBaseExtended(XmlNode xmlNode) : base(xmlNode) { 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; Premium ob = Premium(); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium = new Premium(item); } } } XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise"); if (exerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseIDRef = item.Attributes["id"].Name; Exercise ob = Exercise(); IDManager.SetID(exerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseIDRef = item.Attributes["href"].Name; } else { exercise = new Exercise(item); } } } XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise"); if (americanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in americanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { americanExerciseIDRef = item.Attributes["id"].Name; AmericanExercise ob = AmericanExercise(); IDManager.SetID(americanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { americanExerciseIDRef = item.Attributes["href"].Name; } else { americanExercise = new AmericanExercise(item); } } } XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise"); if (bermudaExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in bermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { bermudaExerciseIDRef = item.Attributes["id"].Name; BermudaExercise ob = BermudaExercise(); IDManager.SetID(bermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { bermudaExerciseIDRef = item.Attributes["href"].Name; } else { bermudaExercise = new BermudaExercise(item); } } } XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise"); if (europeanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in europeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { europeanExerciseIDRef = item.Attributes["id"].Name; EuropeanExercise ob = EuropeanExercise(); IDManager.SetID(europeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { europeanExerciseIDRef = item.Attributes["href"].Name; } else { europeanExercise = new EuropeanExercise(item); } } } XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure"); if (exerciseProcedureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseProcedureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseProcedureIDRef = item.Attributes["id"].Name; ExerciseProcedure ob = ExerciseProcedure(); IDManager.SetID(exerciseProcedureIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseProcedureIDRef = item.Attributes["href"].Name; } else { exerciseProcedure = new ExerciseProcedure(item); } } } XmlNodeList featureNodeList = xmlNode.SelectNodes("feature"); if (featureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in featureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { featureIDRef = item.Attributes["id"].Name; OptionFeature ob = OptionFeature(); IDManager.SetID(featureIDRef, ob); } else if (item.Attributes.ToString() == "href") { featureIDRef = item.Attributes["href"].Name; } else { feature = new OptionFeature(item); } } } XmlNodeList notionalReferenceNodeList = xmlNode.SelectNodes("notionalReference"); if (notionalReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalReferenceIDRef = item.Attributes["id"].Name; NotionalAmountReference ob = NotionalAmountReference(); IDManager.SetID(notionalReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalReferenceIDRef = item.Attributes["href"].Name; } else { notionalReference = new NotionalAmountReference(item); } } } XmlNodeList notionalAmountNodeList = xmlNode.SelectNodes("notionalAmount"); if (notionalAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(notionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalAmountIDRef = item.Attributes["href"].Name; } else { notionalAmount = new Money(item); } } } XmlNodeList optionEntitlementNodeList = xmlNode.SelectNodes("optionEntitlement"); if (optionEntitlementNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionEntitlementNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionEntitlementIDRef = item.Attributes["id"].Name; PositiveDecimal ob = PositiveDecimal(); IDManager.SetID(optionEntitlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionEntitlementIDRef = item.Attributes["href"].Name; } else { optionEntitlement = new PositiveDecimal(item); } } } XmlNodeList entitlementCurrencyNodeList = xmlNode.SelectNodes("entitlementCurrency"); if (entitlementCurrencyNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in entitlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { entitlementCurrencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(entitlementCurrencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { entitlementCurrencyIDRef = item.Attributes["href"].Name; } else { entitlementCurrency = new Currency(item); } } } XmlNodeList numberOfOptionsNodeList = xmlNode.SelectNodes("numberOfOptions"); if (numberOfOptionsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in numberOfOptionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { numberOfOptionsIDRef = item.Attributes["id"].Name; PositiveDecimal ob = PositiveDecimal(); IDManager.SetID(numberOfOptionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { numberOfOptionsIDRef = item.Attributes["href"].Name; } else { numberOfOptions = new PositiveDecimal(item); } } } XmlNodeList settlementTypeNodeList = xmlNode.SelectNodes("settlementType"); if (settlementTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementTypeIDRef = item.Attributes["id"].Name; SettlementTypeEnum ob = SettlementTypeEnum(); IDManager.SetID(settlementTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementTypeIDRef = item.Attributes["href"].Name; } else { settlementType = new SettlementTypeEnum(item); } } } XmlNodeList settlementDateNodeList = xmlNode.SelectNodes("settlementDate"); if (settlementDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementDateIDRef = item.Attributes["id"].Name; AdjustableOrRelativeDate ob = AdjustableOrRelativeDate(); IDManager.SetID(settlementDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementDateIDRef = item.Attributes["href"].Name; } else { settlementDate = new AdjustableOrRelativeDate(item); } } } XmlNodeList settlementAmountNodeList = xmlNode.SelectNodes("settlementAmount"); if (settlementAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(settlementAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementAmountIDRef = item.Attributes["href"].Name; } else { settlementAmount = new Money(item); } } } XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency"); if (settlementCurrencyNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementCurrencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(settlementCurrencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementCurrencyIDRef = item.Attributes["href"].Name; } else { settlementCurrency = new Currency(item); } } } }
public Swaption(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); } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList != null) { this.premium_ = new List<Payment>(); foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { premiumIDRef_ = item.Attributes["id"].Value; premium_.Add(new Payment(item)); IDManager.SetID(premiumIDRef_, premium_[premium_.Count - 1 ]); } else if (item.Attributes["href"] != null) { premiumIDRef_ = item.Attributes["href"].Value; } else { premium_.Add(new Payment(item)); } } else { premium_.Add(new Payment(item)); } } } XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise"); if (exerciseNode != null) { if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) { if (exerciseNode.Attributes["id"] != null) { exerciseIDRef_ = exerciseNode.Attributes["id"].Value; Exercise ob = new Exercise(exerciseNode); IDManager.SetID(exerciseIDRef_, ob); } else if (exerciseNode.Attributes["href"] != null) { exerciseIDRef_ = exerciseNode.Attributes["href"].Value; } else { exercise_ = new Exercise(exerciseNode); } } else { exercise_ = new Exercise(exerciseNode); } } XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise"); if (americanExerciseNode != null) { if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) { if (americanExerciseNode.Attributes["id"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value; AmericanExercise ob = new AmericanExercise(americanExerciseNode); IDManager.SetID(americanExerciseIDRef_, ob); } else if (americanExerciseNode.Attributes["href"] != null) { americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value; } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } else { americanExercise_ = new AmericanExercise(americanExerciseNode); } } XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise"); if (bermudaExerciseNode != null) { if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) { if (bermudaExerciseNode.Attributes["id"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value; BermudaExercise ob = new BermudaExercise(bermudaExerciseNode); IDManager.SetID(bermudaExerciseIDRef_, ob); } else if (bermudaExerciseNode.Attributes["href"] != null) { bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value; } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } else { bermudaExercise_ = new BermudaExercise(bermudaExerciseNode); } } XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise"); if (europeanExerciseNode != null) { if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) { if (europeanExerciseNode.Attributes["id"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value; EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode); IDManager.SetID(europeanExerciseIDRef_, ob); } else if (europeanExerciseNode.Attributes["href"] != null) { europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value; } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } else { europeanExercise_ = new EuropeanExercise(europeanExerciseNode); } } XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure"); if (exerciseProcedureNode != null) { if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null) { if (exerciseProcedureNode.Attributes["id"] != null) { exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value; ExerciseProcedure ob = new ExerciseProcedure(exerciseProcedureNode); IDManager.SetID(exerciseProcedureIDRef_, ob); } else if (exerciseProcedureNode.Attributes["href"] != null) { exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value; } else { exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode); } } else { exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode); } } XmlNode calculationAgentNode = xmlNode.SelectSingleNode("calculationAgent"); if (calculationAgentNode != null) { if (calculationAgentNode.Attributes["href"] != null || calculationAgentNode.Attributes["id"] != null) { if (calculationAgentNode.Attributes["id"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["id"].Value; CalculationAgent ob = new CalculationAgent(calculationAgentNode); IDManager.SetID(calculationAgentIDRef_, ob); } else if (calculationAgentNode.Attributes["href"] != null) { calculationAgentIDRef_ = calculationAgentNode.Attributes["href"].Value; } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } else { calculationAgent_ = new CalculationAgent(calculationAgentNode); } } XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement"); if (cashSettlementNode != null) { if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) { if (cashSettlementNode.Attributes["id"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value; CashSettlement ob = new CashSettlement(cashSettlementNode); IDManager.SetID(cashSettlementIDRef_, ob); } else if (cashSettlementNode.Attributes["href"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value; } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } else { cashSettlement_ = new CashSettlement(cashSettlementNode); } } XmlNode physicalSettlementNode = xmlNode.SelectSingleNode("physicalSettlement"); if (physicalSettlementNode != null) { if (physicalSettlementNode.Attributes["href"] != null || physicalSettlementNode.Attributes["id"] != null) { if (physicalSettlementNode.Attributes["id"] != null) { physicalSettlementIDRef_ = physicalSettlementNode.Attributes["id"].Value; SwaptionPhysicalSettlement ob = new SwaptionPhysicalSettlement(physicalSettlementNode); IDManager.SetID(physicalSettlementIDRef_, ob); } else if (physicalSettlementNode.Attributes["href"] != null) { physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value; } else { physicalSettlement_ = new SwaptionPhysicalSettlement(physicalSettlementNode); } } else { physicalSettlement_ = new SwaptionPhysicalSettlement(physicalSettlementNode); } } XmlNode swaptionStraddleNode = xmlNode.SelectSingleNode("swaptionStraddle"); if (swaptionStraddleNode != null) { if (swaptionStraddleNode.Attributes["href"] != null || swaptionStraddleNode.Attributes["id"] != null) { if (swaptionStraddleNode.Attributes["id"] != null) { swaptionStraddleIDRef_ = swaptionStraddleNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(swaptionStraddleNode); IDManager.SetID(swaptionStraddleIDRef_, ob); } else if (swaptionStraddleNode.Attributes["href"] != null) { swaptionStraddleIDRef_ = swaptionStraddleNode.Attributes["href"].Value; } else { swaptionStraddle_ = new XsdTypeBoolean(swaptionStraddleNode); } } else { swaptionStraddle_ = new XsdTypeBoolean(swaptionStraddleNode); } } XmlNode swaptionAdjustedDatesNode = xmlNode.SelectSingleNode("swaptionAdjustedDates"); if (swaptionAdjustedDatesNode != null) { if (swaptionAdjustedDatesNode.Attributes["href"] != null || swaptionAdjustedDatesNode.Attributes["id"] != null) { if (swaptionAdjustedDatesNode.Attributes["id"] != null) { swaptionAdjustedDatesIDRef_ = swaptionAdjustedDatesNode.Attributes["id"].Value; SwaptionAdjustedDates ob = new SwaptionAdjustedDates(swaptionAdjustedDatesNode); IDManager.SetID(swaptionAdjustedDatesIDRef_, ob); } else if (swaptionAdjustedDatesNode.Attributes["href"] != null) { swaptionAdjustedDatesIDRef_ = swaptionAdjustedDatesNode.Attributes["href"].Value; } else { swaptionAdjustedDates_ = new SwaptionAdjustedDates(swaptionAdjustedDatesNode); } } else { swaptionAdjustedDates_ = new SwaptionAdjustedDates(swaptionAdjustedDatesNode); } } XmlNode swapNode = xmlNode.SelectSingleNode("swap"); if (swapNode != null) { if (swapNode.Attributes["href"] != null || swapNode.Attributes["id"] != null) { if (swapNode.Attributes["id"] != null) { swapIDRef_ = swapNode.Attributes["id"].Value; Swap ob = new Swap(swapNode); IDManager.SetID(swapIDRef_, ob); } else if (swapNode.Attributes["href"] != null) { swapIDRef_ = swapNode.Attributes["href"].Value; } else { swap_ = new Swap(swapNode); } } else { swap_ = new Swap(swapNode); } } }