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 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 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); } } } }