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 EquityExerciseValuationSettlement(XmlNode xmlNode) { XmlNode equityEuropeanExerciseNode = xmlNode.SelectSingleNode("equityEuropeanExercise"); if (equityEuropeanExerciseNode != null) { if (equityEuropeanExerciseNode.Attributes["href"] != null || equityEuropeanExerciseNode.Attributes["id"] != null) { if (equityEuropeanExerciseNode.Attributes["id"] != null) { equityEuropeanExerciseIDRef_ = equityEuropeanExerciseNode.Attributes["id"].Value; EquityEuropeanExercise ob = new EquityEuropeanExercise(equityEuropeanExerciseNode); IDManager.SetID(equityEuropeanExerciseIDRef_, ob); } else if (equityEuropeanExerciseNode.Attributes["href"] != null) { equityEuropeanExerciseIDRef_ = equityEuropeanExerciseNode.Attributes["href"].Value; } else { equityEuropeanExercise_ = new EquityEuropeanExercise(equityEuropeanExerciseNode); } } else { equityEuropeanExercise_ = new EquityEuropeanExercise(equityEuropeanExerciseNode); } } XmlNode equityAmericanExerciseNode = xmlNode.SelectSingleNode("equityAmericanExercise"); if (equityAmericanExerciseNode != null) { if (equityAmericanExerciseNode.Attributes["href"] != null || equityAmericanExerciseNode.Attributes["id"] != null) { if (equityAmericanExerciseNode.Attributes["id"] != null) { equityAmericanExerciseIDRef_ = equityAmericanExerciseNode.Attributes["id"].Value; EquityAmericanExercise ob = new EquityAmericanExercise(equityAmericanExerciseNode); IDManager.SetID(equityAmericanExerciseIDRef_, ob); } else if (equityAmericanExerciseNode.Attributes["href"] != null) { equityAmericanExerciseIDRef_ = equityAmericanExerciseNode.Attributes["href"].Value; } else { equityAmericanExercise_ = new EquityAmericanExercise(equityAmericanExerciseNode); } } else { equityAmericanExercise_ = new EquityAmericanExercise(equityAmericanExerciseNode); } } XmlNode equityBermudaExerciseNode = xmlNode.SelectSingleNode("equityBermudaExercise"); if (equityBermudaExerciseNode != null) { if (equityBermudaExerciseNode.Attributes["href"] != null || equityBermudaExerciseNode.Attributes["id"] != null) { if (equityBermudaExerciseNode.Attributes["id"] != null) { equityBermudaExerciseIDRef_ = equityBermudaExerciseNode.Attributes["id"].Value; EquityBermudaExercise ob = new EquityBermudaExercise(equityBermudaExerciseNode); IDManager.SetID(equityBermudaExerciseIDRef_, ob); } else if (equityBermudaExerciseNode.Attributes["href"] != null) { equityBermudaExerciseIDRef_ = equityBermudaExerciseNode.Attributes["href"].Value; } else { equityBermudaExercise_ = new EquityBermudaExercise(equityBermudaExerciseNode); } } else { equityBermudaExercise_ = new EquityBermudaExercise(equityBermudaExerciseNode); } } XmlNode automaticExerciseNode = xmlNode.SelectSingleNode("automaticExercise"); if (automaticExerciseNode != null) { if (automaticExerciseNode.Attributes["href"] != null || automaticExerciseNode.Attributes["id"] != null) { if (automaticExerciseNode.Attributes["id"] != null) { automaticExerciseIDRef_ = automaticExerciseNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(automaticExerciseNode); IDManager.SetID(automaticExerciseIDRef_, ob); } else if (automaticExerciseNode.Attributes["href"] != null) { automaticExerciseIDRef_ = automaticExerciseNode.Attributes["href"].Value; } else { automaticExercise_ = new XsdTypeBoolean(automaticExerciseNode); } } else { automaticExercise_ = new XsdTypeBoolean(automaticExerciseNode); } } XmlNode makeWholeProvisionsNode = xmlNode.SelectSingleNode("makeWholeProvisions"); if (makeWholeProvisionsNode != null) { if (makeWholeProvisionsNode.Attributes["href"] != null || makeWholeProvisionsNode.Attributes["id"] != null) { if (makeWholeProvisionsNode.Attributes["id"] != null) { makeWholeProvisionsIDRef_ = makeWholeProvisionsNode.Attributes["id"].Value; MakeWholeProvisions ob = new MakeWholeProvisions(makeWholeProvisionsNode); IDManager.SetID(makeWholeProvisionsIDRef_, ob); } else if (makeWholeProvisionsNode.Attributes["href"] != null) { makeWholeProvisionsIDRef_ = makeWholeProvisionsNode.Attributes["href"].Value; } else { makeWholeProvisions_ = new MakeWholeProvisions(makeWholeProvisionsNode); } } else { makeWholeProvisions_ = new MakeWholeProvisions(makeWholeProvisionsNode); } } XmlNode prePaymentNode = xmlNode.SelectSingleNode("prePayment"); if (prePaymentNode != null) { if (prePaymentNode.Attributes["href"] != null || prePaymentNode.Attributes["id"] != null) { if (prePaymentNode.Attributes["id"] != null) { prePaymentIDRef_ = prePaymentNode.Attributes["id"].Value; PrePayment ob = new PrePayment(prePaymentNode); IDManager.SetID(prePaymentIDRef_, ob); } else if (prePaymentNode.Attributes["href"] != null) { prePaymentIDRef_ = prePaymentNode.Attributes["href"].Value; } else { prePayment_ = new PrePayment(prePaymentNode); } } else { prePayment_ = new PrePayment(prePaymentNode); } } XmlNode equityValuationNode = xmlNode.SelectSingleNode("equityValuation"); if (equityValuationNode != null) { if (equityValuationNode.Attributes["href"] != null || equityValuationNode.Attributes["id"] != null) { if (equityValuationNode.Attributes["id"] != null) { equityValuationIDRef_ = equityValuationNode.Attributes["id"].Value; EquityValuation ob = new EquityValuation(equityValuationNode); IDManager.SetID(equityValuationIDRef_, ob); } else if (equityValuationNode.Attributes["href"] != null) { equityValuationIDRef_ = equityValuationNode.Attributes["href"].Value; } else { equityValuation_ = new EquityValuation(equityValuationNode); } } else { equityValuation_ = new EquityValuation(equityValuationNode); } } 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 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); } } XmlNode settlementPriceSourceNode = xmlNode.SelectSingleNode("settlementPriceSource"); if (settlementPriceSourceNode != null) { if (settlementPriceSourceNode.Attributes["href"] != null || settlementPriceSourceNode.Attributes["id"] != null) { if (settlementPriceSourceNode.Attributes["id"] != null) { settlementPriceSourceIDRef_ = settlementPriceSourceNode.Attributes["id"].Value; SettlementPriceSource ob = new SettlementPriceSource(settlementPriceSourceNode); IDManager.SetID(settlementPriceSourceIDRef_, ob); } else if (settlementPriceSourceNode.Attributes["href"] != null) { settlementPriceSourceIDRef_ = settlementPriceSourceNode.Attributes["href"].Value; } else { settlementPriceSource_ = new SettlementPriceSource(settlementPriceSourceNode); } } else { settlementPriceSource_ = new SettlementPriceSource(settlementPriceSourceNode); } } 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 settlementMethodElectionDateNode = xmlNode.SelectSingleNode("settlementMethodElectionDate"); if (settlementMethodElectionDateNode != null) { if (settlementMethodElectionDateNode.Attributes["href"] != null || settlementMethodElectionDateNode.Attributes["id"] != null) { if (settlementMethodElectionDateNode.Attributes["id"] != null) { settlementMethodElectionDateIDRef_ = settlementMethodElectionDateNode.Attributes["id"].Value; AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(settlementMethodElectionDateNode); IDManager.SetID(settlementMethodElectionDateIDRef_, ob); } else if (settlementMethodElectionDateNode.Attributes["href"] != null) { settlementMethodElectionDateIDRef_ = settlementMethodElectionDateNode.Attributes["href"].Value; } else { settlementMethodElectionDate_ = new AdjustableOrRelativeDate(settlementMethodElectionDateNode); } } else { settlementMethodElectionDate_ = new AdjustableOrRelativeDate(settlementMethodElectionDateNode); } } XmlNode settlementMethodElectingPartyReferenceNode = xmlNode.SelectSingleNode("settlementMethodElectingPartyReference"); if (settlementMethodElectingPartyReferenceNode != null) { if (settlementMethodElectingPartyReferenceNode.Attributes["href"] != null || settlementMethodElectingPartyReferenceNode.Attributes["id"] != null) { if (settlementMethodElectingPartyReferenceNode.Attributes["id"] != null) { settlementMethodElectingPartyReferenceIDRef_ = settlementMethodElectingPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(settlementMethodElectingPartyReferenceNode); IDManager.SetID(settlementMethodElectingPartyReferenceIDRef_, ob); } else if (settlementMethodElectingPartyReferenceNode.Attributes["href"] != null) { settlementMethodElectingPartyReferenceIDRef_ = settlementMethodElectingPartyReferenceNode.Attributes["href"].Value; } else { settlementMethodElectingPartyReference_ = new PartyReference(settlementMethodElectingPartyReferenceNode); } } else { settlementMethodElectingPartyReference_ = new PartyReference(settlementMethodElectingPartyReferenceNode); } } XmlNode settlementPriceDefaultElectionNode = xmlNode.SelectSingleNode("settlementPriceDefaultElection"); if (settlementPriceDefaultElectionNode != null) { if (settlementPriceDefaultElectionNode.Attributes["href"] != null || settlementPriceDefaultElectionNode.Attributes["id"] != null) { if (settlementPriceDefaultElectionNode.Attributes["id"] != null) { settlementPriceDefaultElectionIDRef_ = settlementPriceDefaultElectionNode.Attributes["id"].Value; SettlementPriceDefaultElection ob = new SettlementPriceDefaultElection(settlementPriceDefaultElectionNode); IDManager.SetID(settlementPriceDefaultElectionIDRef_, ob); } else if (settlementPriceDefaultElectionNode.Attributes["href"] != null) { settlementPriceDefaultElectionIDRef_ = settlementPriceDefaultElectionNode.Attributes["href"].Value; } else { settlementPriceDefaultElection_ = new SettlementPriceDefaultElection(settlementPriceDefaultElectionNode); } } else { settlementPriceDefaultElection_ = new SettlementPriceDefaultElection(settlementPriceDefaultElectionNode); } } }
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 OptionExercise(XmlNode xmlNode) : base(xmlNode) { XmlNodeList optionSellerNodeList = xmlNode.SelectNodes("optionSeller"); if (optionSellerNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionSellerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionSellerIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(optionSellerIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionSellerIDRef = item.Attributes["href"].Name; } else { optionSeller = new PartyReference(item); } } } XmlNodeList optionBuyerNodeList = xmlNode.SelectNodes("optionBuyer"); if (optionBuyerNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionBuyerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionBuyerIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(optionBuyerIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionBuyerIDRef = item.Attributes["href"].Name; } else { optionBuyer = new PartyReference(item); } } } XmlNodeList originalTradeNodeList = xmlNode.SelectNodes("originalTrade"); if (originalTradeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in originalTradeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { originalTradeIDRef = item.Attributes["id"].Name; Trade ob = Trade(); IDManager.SetID(originalTradeIDRef, ob); } else if (item.Attributes.ToString() == "href") { originalTradeIDRef = item.Attributes["href"].Name; } else { originalTrade = new Trade(item); } } } XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier"); foreach (XmlNode item in tradeIdentifierNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { tradeIdentifierIDRef = item.Attributes["id"].Name; List <PartyTradeIdentifier> ob = new List <PartyTradeIdentifier>(); ob.Add(new PartyTradeIdentifier(item)); IDManager.SetID(tradeIdentifierIDRef, ob); } else if (item.Attributes.ToString() == "href") { tradeIdentifierIDRef = item.Attributes["href"].Name; } else { tradeIdentifier.Add(new PartyTradeIdentifier(item)); } } } XmlNodeList exerciseDateNodeList = xmlNode.SelectNodes("exerciseDate"); if (exerciseDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(exerciseDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseDateIDRef = item.Attributes["href"].Name; } else { exerciseDate = new XsdTypeDate(item); } } } XmlNodeList exerciseTimeNodeList = xmlNode.SelectNodes("exerciseTime"); if (exerciseTimeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseTimeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseTimeIDRef = item.Attributes["id"].Name; XsdTypeTime ob = XsdTypeTime(); IDManager.SetID(exerciseTimeIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseTimeIDRef = item.Attributes["href"].Name; } else { exerciseTime = new XsdTypeTime(item); } } } XmlNodeList expiryNodeList = xmlNode.SelectNodes("expiry"); if (expiryNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in expiryNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { expiryIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(expiryIDRef, ob); } else if (item.Attributes.ToString() == "href") { expiryIDRef = item.Attributes["href"].Name; } else { expiry = new XsdTypeBoolean(item); } } } XmlNodeList fullExerciseNodeList = xmlNode.SelectNodes("fullExercise"); if (fullExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in fullExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fullExerciseIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(fullExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { fullExerciseIDRef = item.Attributes["href"].Name; } else { fullExercise = new XsdTypeBoolean(item); } } } XmlNodeList exerciseInNotionalAmountNodeList = xmlNode.SelectNodes("exerciseInNotionalAmount"); if (exerciseInNotionalAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseInNotionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseInNotionalAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(exerciseInNotionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseInNotionalAmountIDRef = item.Attributes["href"].Name; } else { exerciseInNotionalAmount = new Money(item); } } } XmlNodeList outstandingNotionalAmountNodeList = xmlNode.SelectNodes("outstandingNotionalAmount"); if (outstandingNotionalAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in outstandingNotionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { outstandingNotionalAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(outstandingNotionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { outstandingNotionalAmountIDRef = item.Attributes["href"].Name; } else { outstandingNotionalAmount = new Money(item); } } } XmlNodeList exerciseInNumberOfOptionsNodeList = xmlNode.SelectNodes("exerciseInNumberOfOptions"); if (exerciseInNumberOfOptionsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseInNumberOfOptionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseInNumberOfOptionsIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(exerciseInNumberOfOptionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseInNumberOfOptionsIDRef = item.Attributes["href"].Name; } else { exerciseInNumberOfOptions = new XsdTypeDecimal(item); } } } XmlNodeList outstandingNumberOfOptionsNodeList = xmlNode.SelectNodes("outstandingNumberOfOptions"); if (outstandingNumberOfOptionsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in outstandingNumberOfOptionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { outstandingNumberOfOptionsIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(outstandingNumberOfOptionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { outstandingNumberOfOptionsIDRef = item.Attributes["href"].Name; } else { outstandingNumberOfOptions = new XsdTypeDecimal(item); } } } XmlNodeList exerciseInNumberOfUnitsNodeList = xmlNode.SelectNodes("exerciseInNumberOfUnits"); if (exerciseInNumberOfUnitsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in exerciseInNumberOfUnitsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { exerciseInNumberOfUnitsIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(exerciseInNumberOfUnitsIDRef, ob); } else if (item.Attributes.ToString() == "href") { exerciseInNumberOfUnitsIDRef = item.Attributes["href"].Name; } else { exerciseInNumberOfUnits = new XsdTypeDecimal(item); } } } XmlNodeList outstandingNumberOfUnitsNodeList = xmlNode.SelectNodes("outstandingNumberOfUnits"); if (outstandingNumberOfUnitsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in outstandingNumberOfUnitsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { outstandingNumberOfUnitsIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(outstandingNumberOfUnitsIDRef, ob); } else if (item.Attributes.ToString() == "href") { outstandingNumberOfUnitsIDRef = item.Attributes["href"].Name; } else { outstandingNumberOfUnits = new XsdTypeDecimal(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 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; SimplePayment ob = SimplePayment(); IDManager.SetID(cashSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementIDRef = item.Attributes["href"].Name; } else { cashSettlement = new SimplePayment(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; PhysicalSettlement ob = PhysicalSettlement(); IDManager.SetID(physicalSettlementIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalSettlementIDRef = item.Attributes["href"].Name; } else { physicalSettlement = new PhysicalSettlement(item); } } } XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment"); if (paymentNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in paymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { paymentIDRef = item.Attributes["id"].Name; NonNegativePayment ob = NonNegativePayment(); IDManager.SetID(paymentIDRef, ob); } else if (item.Attributes.ToString() == "href") { paymentIDRef = item.Attributes["href"].Name; } else { payment = new NonNegativePayment(item); } } } }
public OptionExercise(XmlNode xmlNode) : base(xmlNode) { XmlNode optionSellerNode = xmlNode.SelectSingleNode("optionSeller"); if (optionSellerNode != null) { if (optionSellerNode.Attributes["href"] != null || optionSellerNode.Attributes["id"] != null) { if (optionSellerNode.Attributes["id"] != null) { optionSellerIDRef_ = optionSellerNode.Attributes["id"].Value; PartyReference ob = new PartyReference(optionSellerNode); IDManager.SetID(optionSellerIDRef_, ob); } else if (optionSellerNode.Attributes["href"] != null) { optionSellerIDRef_ = optionSellerNode.Attributes["href"].Value; } else { optionSeller_ = new PartyReference(optionSellerNode); } } else { optionSeller_ = new PartyReference(optionSellerNode); } } XmlNode optionBuyerNode = xmlNode.SelectSingleNode("optionBuyer"); if (optionBuyerNode != null) { if (optionBuyerNode.Attributes["href"] != null || optionBuyerNode.Attributes["id"] != null) { if (optionBuyerNode.Attributes["id"] != null) { optionBuyerIDRef_ = optionBuyerNode.Attributes["id"].Value; PartyReference ob = new PartyReference(optionBuyerNode); IDManager.SetID(optionBuyerIDRef_, ob); } else if (optionBuyerNode.Attributes["href"] != null) { optionBuyerIDRef_ = optionBuyerNode.Attributes["href"].Value; } else { optionBuyer_ = new PartyReference(optionBuyerNode); } } else { optionBuyer_ = new PartyReference(optionBuyerNode); } } XmlNode originalTradeNode = xmlNode.SelectSingleNode("originalTrade"); if (originalTradeNode != null) { if (originalTradeNode.Attributes["href"] != null || originalTradeNode.Attributes["id"] != null) { if (originalTradeNode.Attributes["id"] != null) { originalTradeIDRef_ = originalTradeNode.Attributes["id"].Value; Trade ob = new Trade(originalTradeNode); IDManager.SetID(originalTradeIDRef_, ob); } else if (originalTradeNode.Attributes["href"] != null) { originalTradeIDRef_ = originalTradeNode.Attributes["href"].Value; } else { originalTrade_ = new Trade(originalTradeNode); } } else { originalTrade_ = new Trade(originalTradeNode); } } XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier"); if (tradeIdentifierNodeList != null) { this.tradeIdentifier_ = new List<PartyTradeIdentifier>(); foreach (XmlNode item in tradeIdentifierNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { tradeIdentifierIDRef_ = item.Attributes["id"].Value; tradeIdentifier_.Add(new PartyTradeIdentifier(item)); IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1 ]); } else if (item.Attributes["href"] != null) { tradeIdentifierIDRef_ = item.Attributes["href"].Value; } else { tradeIdentifier_.Add(new PartyTradeIdentifier(item)); } } else { tradeIdentifier_.Add(new PartyTradeIdentifier(item)); } } } XmlNode exerciseDateNode = xmlNode.SelectSingleNode("exerciseDate"); if (exerciseDateNode != null) { if (exerciseDateNode.Attributes["href"] != null || exerciseDateNode.Attributes["id"] != null) { if (exerciseDateNode.Attributes["id"] != null) { exerciseDateIDRef_ = exerciseDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(exerciseDateNode); IDManager.SetID(exerciseDateIDRef_, ob); } else if (exerciseDateNode.Attributes["href"] != null) { exerciseDateIDRef_ = exerciseDateNode.Attributes["href"].Value; } else { exerciseDate_ = new XsdTypeDate(exerciseDateNode); } } else { exerciseDate_ = new XsdTypeDate(exerciseDateNode); } } XmlNode exerciseTimeNode = xmlNode.SelectSingleNode("exerciseTime"); if (exerciseTimeNode != null) { if (exerciseTimeNode.Attributes["href"] != null || exerciseTimeNode.Attributes["id"] != null) { if (exerciseTimeNode.Attributes["id"] != null) { exerciseTimeIDRef_ = exerciseTimeNode.Attributes["id"].Value; XsdTypeTime ob = new XsdTypeTime(exerciseTimeNode); IDManager.SetID(exerciseTimeIDRef_, ob); } else if (exerciseTimeNode.Attributes["href"] != null) { exerciseTimeIDRef_ = exerciseTimeNode.Attributes["href"].Value; } else { exerciseTime_ = new XsdTypeTime(exerciseTimeNode); } } else { exerciseTime_ = new XsdTypeTime(exerciseTimeNode); } } XmlNode expiryNode = xmlNode.SelectSingleNode("expiry"); if (expiryNode != null) { if (expiryNode.Attributes["href"] != null || expiryNode.Attributes["id"] != null) { if (expiryNode.Attributes["id"] != null) { expiryIDRef_ = expiryNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(expiryNode); IDManager.SetID(expiryIDRef_, ob); } else if (expiryNode.Attributes["href"] != null) { expiryIDRef_ = expiryNode.Attributes["href"].Value; } else { expiry_ = new XsdTypeBoolean(expiryNode); } } else { expiry_ = new XsdTypeBoolean(expiryNode); } } XmlNode fullExerciseNode = xmlNode.SelectSingleNode("fullExercise"); if (fullExerciseNode != null) { if (fullExerciseNode.Attributes["href"] != null || fullExerciseNode.Attributes["id"] != null) { if (fullExerciseNode.Attributes["id"] != null) { fullExerciseIDRef_ = fullExerciseNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(fullExerciseNode); IDManager.SetID(fullExerciseIDRef_, ob); } else if (fullExerciseNode.Attributes["href"] != null) { fullExerciseIDRef_ = fullExerciseNode.Attributes["href"].Value; } else { fullExercise_ = new XsdTypeBoolean(fullExerciseNode); } } else { fullExercise_ = new XsdTypeBoolean(fullExerciseNode); } } XmlNode exerciseInNotionalAmountNode = xmlNode.SelectSingleNode("exerciseInNotionalAmount"); if (exerciseInNotionalAmountNode != null) { if (exerciseInNotionalAmountNode.Attributes["href"] != null || exerciseInNotionalAmountNode.Attributes["id"] != null) { if (exerciseInNotionalAmountNode.Attributes["id"] != null) { exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["id"].Value; Money ob = new Money(exerciseInNotionalAmountNode); IDManager.SetID(exerciseInNotionalAmountIDRef_, ob); } else if (exerciseInNotionalAmountNode.Attributes["href"] != null) { exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["href"].Value; } else { exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode); } } else { exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode); } } XmlNode outstandingNotionalAmountNode = xmlNode.SelectSingleNode("outstandingNotionalAmount"); if (outstandingNotionalAmountNode != null) { if (outstandingNotionalAmountNode.Attributes["href"] != null || outstandingNotionalAmountNode.Attributes["id"] != null) { if (outstandingNotionalAmountNode.Attributes["id"] != null) { outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["id"].Value; Money ob = new Money(outstandingNotionalAmountNode); IDManager.SetID(outstandingNotionalAmountIDRef_, ob); } else if (outstandingNotionalAmountNode.Attributes["href"] != null) { outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["href"].Value; } else { outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode); } } else { outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode); } } XmlNode exerciseInNumberOfOptionsNode = xmlNode.SelectSingleNode("exerciseInNumberOfOptions"); if (exerciseInNumberOfOptionsNode != null) { if (exerciseInNumberOfOptionsNode.Attributes["href"] != null || exerciseInNumberOfOptionsNode.Attributes["id"] != null) { if (exerciseInNumberOfOptionsNode.Attributes["id"] != null) { exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfOptionsNode); IDManager.SetID(exerciseInNumberOfOptionsIDRef_, ob); } else if (exerciseInNumberOfOptionsNode.Attributes["href"] != null) { exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["href"].Value; } else { exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode); } } else { exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode); } } XmlNode outstandingNumberOfOptionsNode = xmlNode.SelectSingleNode("outstandingNumberOfOptions"); if (outstandingNumberOfOptionsNode != null) { if (outstandingNumberOfOptionsNode.Attributes["href"] != null || outstandingNumberOfOptionsNode.Attributes["id"] != null) { if (outstandingNumberOfOptionsNode.Attributes["id"] != null) { outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfOptionsNode); IDManager.SetID(outstandingNumberOfOptionsIDRef_, ob); } else if (outstandingNumberOfOptionsNode.Attributes["href"] != null) { outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["href"].Value; } else { outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode); } } else { outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode); } } XmlNode exerciseInNumberOfUnitsNode = xmlNode.SelectSingleNode("exerciseInNumberOfUnits"); if (exerciseInNumberOfUnitsNode != null) { if (exerciseInNumberOfUnitsNode.Attributes["href"] != null || exerciseInNumberOfUnitsNode.Attributes["id"] != null) { if (exerciseInNumberOfUnitsNode.Attributes["id"] != null) { exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfUnitsNode); IDManager.SetID(exerciseInNumberOfUnitsIDRef_, ob); } else if (exerciseInNumberOfUnitsNode.Attributes["href"] != null) { exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["href"].Value; } else { exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode); } } else { exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode); } } XmlNode outstandingNumberOfUnitsNode = xmlNode.SelectSingleNode("outstandingNumberOfUnits"); if (outstandingNumberOfUnitsNode != null) { if (outstandingNumberOfUnitsNode.Attributes["href"] != null || outstandingNumberOfUnitsNode.Attributes["id"] != null) { if (outstandingNumberOfUnitsNode.Attributes["id"] != null) { outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfUnitsNode); IDManager.SetID(outstandingNumberOfUnitsIDRef_, ob); } else if (outstandingNumberOfUnitsNode.Attributes["href"] != null) { outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["href"].Value; } else { outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode); } } else { outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode); } } 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 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; SimplePayment ob = new SimplePayment(cashSettlementNode); IDManager.SetID(cashSettlementIDRef_, ob); } else if (cashSettlementNode.Attributes["href"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value; } else { cashSettlement_ = new SimplePayment(cashSettlementNode); } } else { cashSettlement_ = new SimplePayment(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; PhysicalSettlement ob = new PhysicalSettlement(physicalSettlementNode); IDManager.SetID(physicalSettlementIDRef_, ob); } else if (physicalSettlementNode.Attributes["href"] != null) { physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value; } else { physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode); } } else { physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode); } } XmlNode paymentNode = xmlNode.SelectSingleNode("payment"); if (paymentNode != null) { if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null) { if (paymentNode.Attributes["id"] != null) { paymentIDRef_ = paymentNode.Attributes["id"].Value; NonNegativePayment ob = new NonNegativePayment(paymentNode); IDManager.SetID(paymentIDRef_, ob); } else if (paymentNode.Attributes["href"] != null) { paymentIDRef_ = paymentNode.Attributes["href"].Value; } else { payment_ = new NonNegativePayment(paymentNode); } } else { payment_ = new NonNegativePayment(paymentNode); } } }
public OptionExercise(XmlNode xmlNode) : base(xmlNode) { XmlNode optionSellerNode = xmlNode.SelectSingleNode("optionSeller"); if (optionSellerNode != null) { if (optionSellerNode.Attributes["href"] != null || optionSellerNode.Attributes["id"] != null) { if (optionSellerNode.Attributes["id"] != null) { optionSellerIDRef_ = optionSellerNode.Attributes["id"].Value; PartyReference ob = new PartyReference(optionSellerNode); IDManager.SetID(optionSellerIDRef_, ob); } else if (optionSellerNode.Attributes["href"] != null) { optionSellerIDRef_ = optionSellerNode.Attributes["href"].Value; } else { optionSeller_ = new PartyReference(optionSellerNode); } } else { optionSeller_ = new PartyReference(optionSellerNode); } } XmlNode optionBuyerNode = xmlNode.SelectSingleNode("optionBuyer"); if (optionBuyerNode != null) { if (optionBuyerNode.Attributes["href"] != null || optionBuyerNode.Attributes["id"] != null) { if (optionBuyerNode.Attributes["id"] != null) { optionBuyerIDRef_ = optionBuyerNode.Attributes["id"].Value; PartyReference ob = new PartyReference(optionBuyerNode); IDManager.SetID(optionBuyerIDRef_, ob); } else if (optionBuyerNode.Attributes["href"] != null) { optionBuyerIDRef_ = optionBuyerNode.Attributes["href"].Value; } else { optionBuyer_ = new PartyReference(optionBuyerNode); } } else { optionBuyer_ = new PartyReference(optionBuyerNode); } } XmlNode originalTradeNode = xmlNode.SelectSingleNode("originalTrade"); if (originalTradeNode != null) { if (originalTradeNode.Attributes["href"] != null || originalTradeNode.Attributes["id"] != null) { if (originalTradeNode.Attributes["id"] != null) { originalTradeIDRef_ = originalTradeNode.Attributes["id"].Value; Trade ob = new Trade(originalTradeNode); IDManager.SetID(originalTradeIDRef_, ob); } else if (originalTradeNode.Attributes["href"] != null) { originalTradeIDRef_ = originalTradeNode.Attributes["href"].Value; } else { originalTrade_ = new Trade(originalTradeNode); } } else { originalTrade_ = new Trade(originalTradeNode); } } XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier"); if (tradeIdentifierNodeList != null) { this.tradeIdentifier_ = new List <PartyTradeIdentifier>(); foreach (XmlNode item in tradeIdentifierNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { tradeIdentifierIDRef_ = item.Attributes["id"].Value; tradeIdentifier_.Add(new PartyTradeIdentifier(item)); IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1]); } else if (item.Attributes["href"] != null) { tradeIdentifierIDRef_ = item.Attributes["href"].Value; } else { tradeIdentifier_.Add(new PartyTradeIdentifier(item)); } } else { tradeIdentifier_.Add(new PartyTradeIdentifier(item)); } } } XmlNode exerciseDateNode = xmlNode.SelectSingleNode("exerciseDate"); if (exerciseDateNode != null) { if (exerciseDateNode.Attributes["href"] != null || exerciseDateNode.Attributes["id"] != null) { if (exerciseDateNode.Attributes["id"] != null) { exerciseDateIDRef_ = exerciseDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(exerciseDateNode); IDManager.SetID(exerciseDateIDRef_, ob); } else if (exerciseDateNode.Attributes["href"] != null) { exerciseDateIDRef_ = exerciseDateNode.Attributes["href"].Value; } else { exerciseDate_ = new XsdTypeDate(exerciseDateNode); } } else { exerciseDate_ = new XsdTypeDate(exerciseDateNode); } } XmlNode exerciseTimeNode = xmlNode.SelectSingleNode("exerciseTime"); if (exerciseTimeNode != null) { if (exerciseTimeNode.Attributes["href"] != null || exerciseTimeNode.Attributes["id"] != null) { if (exerciseTimeNode.Attributes["id"] != null) { exerciseTimeIDRef_ = exerciseTimeNode.Attributes["id"].Value; XsdTypeTime ob = new XsdTypeTime(exerciseTimeNode); IDManager.SetID(exerciseTimeIDRef_, ob); } else if (exerciseTimeNode.Attributes["href"] != null) { exerciseTimeIDRef_ = exerciseTimeNode.Attributes["href"].Value; } else { exerciseTime_ = new XsdTypeTime(exerciseTimeNode); } } else { exerciseTime_ = new XsdTypeTime(exerciseTimeNode); } } XmlNode expiryNode = xmlNode.SelectSingleNode("expiry"); if (expiryNode != null) { if (expiryNode.Attributes["href"] != null || expiryNode.Attributes["id"] != null) { if (expiryNode.Attributes["id"] != null) { expiryIDRef_ = expiryNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(expiryNode); IDManager.SetID(expiryIDRef_, ob); } else if (expiryNode.Attributes["href"] != null) { expiryIDRef_ = expiryNode.Attributes["href"].Value; } else { expiry_ = new XsdTypeBoolean(expiryNode); } } else { expiry_ = new XsdTypeBoolean(expiryNode); } } XmlNode fullExerciseNode = xmlNode.SelectSingleNode("fullExercise"); if (fullExerciseNode != null) { if (fullExerciseNode.Attributes["href"] != null || fullExerciseNode.Attributes["id"] != null) { if (fullExerciseNode.Attributes["id"] != null) { fullExerciseIDRef_ = fullExerciseNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(fullExerciseNode); IDManager.SetID(fullExerciseIDRef_, ob); } else if (fullExerciseNode.Attributes["href"] != null) { fullExerciseIDRef_ = fullExerciseNode.Attributes["href"].Value; } else { fullExercise_ = new XsdTypeBoolean(fullExerciseNode); } } else { fullExercise_ = new XsdTypeBoolean(fullExerciseNode); } } XmlNode exerciseInNotionalAmountNode = xmlNode.SelectSingleNode("exerciseInNotionalAmount"); if (exerciseInNotionalAmountNode != null) { if (exerciseInNotionalAmountNode.Attributes["href"] != null || exerciseInNotionalAmountNode.Attributes["id"] != null) { if (exerciseInNotionalAmountNode.Attributes["id"] != null) { exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["id"].Value; Money ob = new Money(exerciseInNotionalAmountNode); IDManager.SetID(exerciseInNotionalAmountIDRef_, ob); } else if (exerciseInNotionalAmountNode.Attributes["href"] != null) { exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["href"].Value; } else { exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode); } } else { exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode); } } XmlNode outstandingNotionalAmountNode = xmlNode.SelectSingleNode("outstandingNotionalAmount"); if (outstandingNotionalAmountNode != null) { if (outstandingNotionalAmountNode.Attributes["href"] != null || outstandingNotionalAmountNode.Attributes["id"] != null) { if (outstandingNotionalAmountNode.Attributes["id"] != null) { outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["id"].Value; Money ob = new Money(outstandingNotionalAmountNode); IDManager.SetID(outstandingNotionalAmountIDRef_, ob); } else if (outstandingNotionalAmountNode.Attributes["href"] != null) { outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["href"].Value; } else { outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode); } } else { outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode); } } XmlNode exerciseInNumberOfOptionsNode = xmlNode.SelectSingleNode("exerciseInNumberOfOptions"); if (exerciseInNumberOfOptionsNode != null) { if (exerciseInNumberOfOptionsNode.Attributes["href"] != null || exerciseInNumberOfOptionsNode.Attributes["id"] != null) { if (exerciseInNumberOfOptionsNode.Attributes["id"] != null) { exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfOptionsNode); IDManager.SetID(exerciseInNumberOfOptionsIDRef_, ob); } else if (exerciseInNumberOfOptionsNode.Attributes["href"] != null) { exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["href"].Value; } else { exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode); } } else { exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode); } } XmlNode outstandingNumberOfOptionsNode = xmlNode.SelectSingleNode("outstandingNumberOfOptions"); if (outstandingNumberOfOptionsNode != null) { if (outstandingNumberOfOptionsNode.Attributes["href"] != null || outstandingNumberOfOptionsNode.Attributes["id"] != null) { if (outstandingNumberOfOptionsNode.Attributes["id"] != null) { outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfOptionsNode); IDManager.SetID(outstandingNumberOfOptionsIDRef_, ob); } else if (outstandingNumberOfOptionsNode.Attributes["href"] != null) { outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["href"].Value; } else { outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode); } } else { outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode); } } XmlNode exerciseInNumberOfUnitsNode = xmlNode.SelectSingleNode("exerciseInNumberOfUnits"); if (exerciseInNumberOfUnitsNode != null) { if (exerciseInNumberOfUnitsNode.Attributes["href"] != null || exerciseInNumberOfUnitsNode.Attributes["id"] != null) { if (exerciseInNumberOfUnitsNode.Attributes["id"] != null) { exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfUnitsNode); IDManager.SetID(exerciseInNumberOfUnitsIDRef_, ob); } else if (exerciseInNumberOfUnitsNode.Attributes["href"] != null) { exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["href"].Value; } else { exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode); } } else { exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode); } } XmlNode outstandingNumberOfUnitsNode = xmlNode.SelectSingleNode("outstandingNumberOfUnits"); if (outstandingNumberOfUnitsNode != null) { if (outstandingNumberOfUnitsNode.Attributes["href"] != null || outstandingNumberOfUnitsNode.Attributes["id"] != null) { if (outstandingNumberOfUnitsNode.Attributes["id"] != null) { outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfUnitsNode); IDManager.SetID(outstandingNumberOfUnitsIDRef_, ob); } else if (outstandingNumberOfUnitsNode.Attributes["href"] != null) { outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["href"].Value; } else { outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode); } } else { outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode); } } 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 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; SimplePayment ob = new SimplePayment(cashSettlementNode); IDManager.SetID(cashSettlementIDRef_, ob); } else if (cashSettlementNode.Attributes["href"] != null) { cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value; } else { cashSettlement_ = new SimplePayment(cashSettlementNode); } } else { cashSettlement_ = new SimplePayment(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; PhysicalSettlement ob = new PhysicalSettlement(physicalSettlementNode); IDManager.SetID(physicalSettlementIDRef_, ob); } else if (physicalSettlementNode.Attributes["href"] != null) { physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value; } else { physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode); } } else { physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode); } } XmlNode paymentNode = xmlNode.SelectSingleNode("payment"); if (paymentNode != null) { if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null) { if (paymentNode.Attributes["id"] != null) { paymentIDRef_ = paymentNode.Attributes["id"].Value; NonNegativePayment ob = new NonNegativePayment(paymentNode); IDManager.SetID(paymentIDRef_, ob); } else if (paymentNode.Attributes["href"] != null) { paymentIDRef_ = paymentNode.Attributes["href"].Value; } else { payment_ = new NonNegativePayment(paymentNode); } } else { payment_ = new NonNegativePayment(paymentNode); } } }
public EquityExerciseValuationSettlement(XmlNode xmlNode) { XmlNode equityEuropeanExerciseNode = xmlNode.SelectSingleNode("equityEuropeanExercise"); if (equityEuropeanExerciseNode != null) { if (equityEuropeanExerciseNode.Attributes["href"] != null || equityEuropeanExerciseNode.Attributes["id"] != null) { if (equityEuropeanExerciseNode.Attributes["id"] != null) { equityEuropeanExerciseIDRef_ = equityEuropeanExerciseNode.Attributes["id"].Value; EquityEuropeanExercise ob = new EquityEuropeanExercise(equityEuropeanExerciseNode); IDManager.SetID(equityEuropeanExerciseIDRef_, ob); } else if (equityEuropeanExerciseNode.Attributes["href"] != null) { equityEuropeanExerciseIDRef_ = equityEuropeanExerciseNode.Attributes["href"].Value; } else { equityEuropeanExercise_ = new EquityEuropeanExercise(equityEuropeanExerciseNode); } } else { equityEuropeanExercise_ = new EquityEuropeanExercise(equityEuropeanExerciseNode); } } XmlNode equityAmericanExerciseNode = xmlNode.SelectSingleNode("equityAmericanExercise"); if (equityAmericanExerciseNode != null) { if (equityAmericanExerciseNode.Attributes["href"] != null || equityAmericanExerciseNode.Attributes["id"] != null) { if (equityAmericanExerciseNode.Attributes["id"] != null) { equityAmericanExerciseIDRef_ = equityAmericanExerciseNode.Attributes["id"].Value; EquityAmericanExercise ob = new EquityAmericanExercise(equityAmericanExerciseNode); IDManager.SetID(equityAmericanExerciseIDRef_, ob); } else if (equityAmericanExerciseNode.Attributes["href"] != null) { equityAmericanExerciseIDRef_ = equityAmericanExerciseNode.Attributes["href"].Value; } else { equityAmericanExercise_ = new EquityAmericanExercise(equityAmericanExerciseNode); } } else { equityAmericanExercise_ = new EquityAmericanExercise(equityAmericanExerciseNode); } } XmlNode equityBermudaExerciseNode = xmlNode.SelectSingleNode("equityBermudaExercise"); if (equityBermudaExerciseNode != null) { if (equityBermudaExerciseNode.Attributes["href"] != null || equityBermudaExerciseNode.Attributes["id"] != null) { if (equityBermudaExerciseNode.Attributes["id"] != null) { equityBermudaExerciseIDRef_ = equityBermudaExerciseNode.Attributes["id"].Value; EquityBermudaExercise ob = new EquityBermudaExercise(equityBermudaExerciseNode); IDManager.SetID(equityBermudaExerciseIDRef_, ob); } else if (equityBermudaExerciseNode.Attributes["href"] != null) { equityBermudaExerciseIDRef_ = equityBermudaExerciseNode.Attributes["href"].Value; } else { equityBermudaExercise_ = new EquityBermudaExercise(equityBermudaExerciseNode); } } else { equityBermudaExercise_ = new EquityBermudaExercise(equityBermudaExerciseNode); } } XmlNode automaticExerciseNode = xmlNode.SelectSingleNode("automaticExercise"); if (automaticExerciseNode != null) { if (automaticExerciseNode.Attributes["href"] != null || automaticExerciseNode.Attributes["id"] != null) { if (automaticExerciseNode.Attributes["id"] != null) { automaticExerciseIDRef_ = automaticExerciseNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(automaticExerciseNode); IDManager.SetID(automaticExerciseIDRef_, ob); } else if (automaticExerciseNode.Attributes["href"] != null) { automaticExerciseIDRef_ = automaticExerciseNode.Attributes["href"].Value; } else { automaticExercise_ = new XsdTypeBoolean(automaticExerciseNode); } } else { automaticExercise_ = new XsdTypeBoolean(automaticExerciseNode); } } XmlNode makeWholeProvisionsNode = xmlNode.SelectSingleNode("makeWholeProvisions"); if (makeWholeProvisionsNode != null) { if (makeWholeProvisionsNode.Attributes["href"] != null || makeWholeProvisionsNode.Attributes["id"] != null) { if (makeWholeProvisionsNode.Attributes["id"] != null) { makeWholeProvisionsIDRef_ = makeWholeProvisionsNode.Attributes["id"].Value; MakeWholeProvisions ob = new MakeWholeProvisions(makeWholeProvisionsNode); IDManager.SetID(makeWholeProvisionsIDRef_, ob); } else if (makeWholeProvisionsNode.Attributes["href"] != null) { makeWholeProvisionsIDRef_ = makeWholeProvisionsNode.Attributes["href"].Value; } else { makeWholeProvisions_ = new MakeWholeProvisions(makeWholeProvisionsNode); } } else { makeWholeProvisions_ = new MakeWholeProvisions(makeWholeProvisionsNode); } } XmlNode prePaymentNode = xmlNode.SelectSingleNode("prePayment"); if (prePaymentNode != null) { if (prePaymentNode.Attributes["href"] != null || prePaymentNode.Attributes["id"] != null) { if (prePaymentNode.Attributes["id"] != null) { prePaymentIDRef_ = prePaymentNode.Attributes["id"].Value; PrePayment ob = new PrePayment(prePaymentNode); IDManager.SetID(prePaymentIDRef_, ob); } else if (prePaymentNode.Attributes["href"] != null) { prePaymentIDRef_ = prePaymentNode.Attributes["href"].Value; } else { prePayment_ = new PrePayment(prePaymentNode); } } else { prePayment_ = new PrePayment(prePaymentNode); } } XmlNode equityValuationNode = xmlNode.SelectSingleNode("equityValuation"); if (equityValuationNode != null) { if (equityValuationNode.Attributes["href"] != null || equityValuationNode.Attributes["id"] != null) { if (equityValuationNode.Attributes["id"] != null) { equityValuationIDRef_ = equityValuationNode.Attributes["id"].Value; EquityValuation ob = new EquityValuation(equityValuationNode); IDManager.SetID(equityValuationIDRef_, ob); } else if (equityValuationNode.Attributes["href"] != null) { equityValuationIDRef_ = equityValuationNode.Attributes["href"].Value; } else { equityValuation_ = new EquityValuation(equityValuationNode); } } else { equityValuation_ = new EquityValuation(equityValuationNode); } } 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 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); } } XmlNode settlementPriceSourceNode = xmlNode.SelectSingleNode("settlementPriceSource"); if (settlementPriceSourceNode != null) { if (settlementPriceSourceNode.Attributes["href"] != null || settlementPriceSourceNode.Attributes["id"] != null) { if (settlementPriceSourceNode.Attributes["id"] != null) { settlementPriceSourceIDRef_ = settlementPriceSourceNode.Attributes["id"].Value; SettlementPriceSource ob = new SettlementPriceSource(settlementPriceSourceNode); IDManager.SetID(settlementPriceSourceIDRef_, ob); } else if (settlementPriceSourceNode.Attributes["href"] != null) { settlementPriceSourceIDRef_ = settlementPriceSourceNode.Attributes["href"].Value; } else { settlementPriceSource_ = new SettlementPriceSource(settlementPriceSourceNode); } } else { settlementPriceSource_ = new SettlementPriceSource(settlementPriceSourceNode); } } 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 settlementMethodElectionDateNode = xmlNode.SelectSingleNode("settlementMethodElectionDate"); if (settlementMethodElectionDateNode != null) { if (settlementMethodElectionDateNode.Attributes["href"] != null || settlementMethodElectionDateNode.Attributes["id"] != null) { if (settlementMethodElectionDateNode.Attributes["id"] != null) { settlementMethodElectionDateIDRef_ = settlementMethodElectionDateNode.Attributes["id"].Value; AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(settlementMethodElectionDateNode); IDManager.SetID(settlementMethodElectionDateIDRef_, ob); } else if (settlementMethodElectionDateNode.Attributes["href"] != null) { settlementMethodElectionDateIDRef_ = settlementMethodElectionDateNode.Attributes["href"].Value; } else { settlementMethodElectionDate_ = new AdjustableOrRelativeDate(settlementMethodElectionDateNode); } } else { settlementMethodElectionDate_ = new AdjustableOrRelativeDate(settlementMethodElectionDateNode); } } XmlNode settlementMethodElectingPartyReferenceNode = xmlNode.SelectSingleNode("settlementMethodElectingPartyReference"); if (settlementMethodElectingPartyReferenceNode != null) { if (settlementMethodElectingPartyReferenceNode.Attributes["href"] != null || settlementMethodElectingPartyReferenceNode.Attributes["id"] != null) { if (settlementMethodElectingPartyReferenceNode.Attributes["id"] != null) { settlementMethodElectingPartyReferenceIDRef_ = settlementMethodElectingPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(settlementMethodElectingPartyReferenceNode); IDManager.SetID(settlementMethodElectingPartyReferenceIDRef_, ob); } else if (settlementMethodElectingPartyReferenceNode.Attributes["href"] != null) { settlementMethodElectingPartyReferenceIDRef_ = settlementMethodElectingPartyReferenceNode.Attributes["href"].Value; } else { settlementMethodElectingPartyReference_ = new PartyReference(settlementMethodElectingPartyReferenceNode); } } else { settlementMethodElectingPartyReference_ = new PartyReference(settlementMethodElectingPartyReferenceNode); } } XmlNode settlementPriceDefaultElectionNode = xmlNode.SelectSingleNode("settlementPriceDefaultElection"); if (settlementPriceDefaultElectionNode != null) { if (settlementPriceDefaultElectionNode.Attributes["href"] != null || settlementPriceDefaultElectionNode.Attributes["id"] != null) { if (settlementPriceDefaultElectionNode.Attributes["id"] != null) { settlementPriceDefaultElectionIDRef_ = settlementPriceDefaultElectionNode.Attributes["id"].Value; SettlementPriceDefaultElection ob = new SettlementPriceDefaultElection(settlementPriceDefaultElectionNode); IDManager.SetID(settlementPriceDefaultElectionIDRef_, ob); } else if (settlementPriceDefaultElectionNode.Attributes["href"] != null) { settlementPriceDefaultElectionIDRef_ = settlementPriceDefaultElectionNode.Attributes["href"].Value; } else { settlementPriceDefaultElection_ = new SettlementPriceDefaultElection(settlementPriceDefaultElectionNode); } } else { settlementPriceDefaultElection_ = new SettlementPriceDefaultElection(settlementPriceDefaultElectionNode); } } }
public DirectionalLegUnderlyer(XmlNode xmlNode) : base(xmlNode) { XmlNode underlyerNode = xmlNode.SelectSingleNode("underlyer"); if (underlyerNode != null) { if (underlyerNode.Attributes["href"] != null || underlyerNode.Attributes["id"] != null) { if (underlyerNode.Attributes["id"] != null) { underlyerIDRef_ = underlyerNode.Attributes["id"].Value; Underlyer ob = new Underlyer(underlyerNode); IDManager.SetID(underlyerIDRef_, ob); } else if (underlyerNode.Attributes["href"] != null) { underlyerIDRef_ = underlyerNode.Attributes["href"].Value; } else { underlyer_ = new Underlyer(underlyerNode); } } else { underlyer_ = new Underlyer(underlyerNode); } } 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); } } XmlNode fxFeatureNode = xmlNode.SelectSingleNode("fxFeature"); if (fxFeatureNode != null) { if (fxFeatureNode.Attributes["href"] != null || fxFeatureNode.Attributes["id"] != null) { if (fxFeatureNode.Attributes["id"] != null) { fxFeatureIDRef_ = fxFeatureNode.Attributes["id"].Value; FxFeature ob = new FxFeature(fxFeatureNode); IDManager.SetID(fxFeatureIDRef_, ob); } else if (fxFeatureNode.Attributes["href"] != null) { fxFeatureIDRef_ = fxFeatureNode.Attributes["href"].Value; } else { fxFeature_ = new FxFeature(fxFeatureNode); } } else { fxFeature_ = new FxFeature(fxFeatureNode); } } }
public EquityExerciseValuationSettlement(XmlNode xmlNode) { XmlNodeList equityEuropeanExerciseNodeList = xmlNode.SelectNodes("equityEuropeanExercise"); if (equityEuropeanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in equityEuropeanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityEuropeanExerciseIDRef = item.Attributes["id"].Name; EquityEuropeanExercise ob = EquityEuropeanExercise(); IDManager.SetID(equityEuropeanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityEuropeanExerciseIDRef = item.Attributes["href"].Name; } else { equityEuropeanExercise = new EquityEuropeanExercise(item); } } } XmlNodeList equityAmericanExerciseNodeList = xmlNode.SelectNodes("equityAmericanExercise"); if (equityAmericanExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in equityAmericanExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityAmericanExerciseIDRef = item.Attributes["id"].Name; EquityAmericanExercise ob = EquityAmericanExercise(); IDManager.SetID(equityAmericanExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityAmericanExerciseIDRef = item.Attributes["href"].Name; } else { equityAmericanExercise = new EquityAmericanExercise(item); } } } XmlNodeList equityBermudaExerciseNodeList = xmlNode.SelectNodes("equityBermudaExercise"); if (equityBermudaExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in equityBermudaExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityBermudaExerciseIDRef = item.Attributes["id"].Name; EquityBermudaExercise ob = EquityBermudaExercise(); IDManager.SetID(equityBermudaExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityBermudaExerciseIDRef = item.Attributes["href"].Name; } else { equityBermudaExercise = new EquityBermudaExercise(item); } } } XmlNodeList automaticExerciseNodeList = xmlNode.SelectNodes("automaticExercise"); if (automaticExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in automaticExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { automaticExerciseIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(automaticExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { automaticExerciseIDRef = item.Attributes["href"].Name; } else { automaticExercise = new XsdTypeBoolean(item); } } } XmlNodeList makeWholeProvisionsNodeList = xmlNode.SelectNodes("makeWholeProvisions"); if (makeWholeProvisionsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in makeWholeProvisionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { makeWholeProvisionsIDRef = item.Attributes["id"].Name; MakeWholeProvisions ob = MakeWholeProvisions(); IDManager.SetID(makeWholeProvisionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { makeWholeProvisionsIDRef = item.Attributes["href"].Name; } else { makeWholeProvisions = new MakeWholeProvisions(item); } } } XmlNodeList prePaymentNodeList = xmlNode.SelectNodes("prePayment"); if (prePaymentNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in prePaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { prePaymentIDRef = item.Attributes["id"].Name; PrePayment ob = PrePayment(); IDManager.SetID(prePaymentIDRef, ob); } else if (item.Attributes.ToString() == "href") { prePaymentIDRef = item.Attributes["href"].Name; } else { prePayment = new PrePayment(item); } } } XmlNodeList equityValuationNodeList = xmlNode.SelectNodes("equityValuation"); if (equityValuationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in equityValuationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityValuationIDRef = item.Attributes["id"].Name; EquityValuation ob = EquityValuation(); IDManager.SetID(equityValuationIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityValuationIDRef = item.Attributes["href"].Name; } else { equityValuation = new EquityValuation(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 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); } } } XmlNodeList settlementPriceSourceNodeList = xmlNode.SelectNodes("settlementPriceSource"); if (settlementPriceSourceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementPriceSourceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementPriceSourceIDRef = item.Attributes["id"].Name; SettlementPriceSource ob = SettlementPriceSource(); IDManager.SetID(settlementPriceSourceIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementPriceSourceIDRef = item.Attributes["href"].Name; } else { settlementPriceSource = new SettlementPriceSource(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 settlementMethodElectionDateNodeList = xmlNode.SelectNodes("settlementMethodElectionDate"); if (settlementMethodElectionDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementMethodElectionDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementMethodElectionDateIDRef = item.Attributes["id"].Name; AdjustableOrRelativeDate ob = AdjustableOrRelativeDate(); IDManager.SetID(settlementMethodElectionDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementMethodElectionDateIDRef = item.Attributes["href"].Name; } else { settlementMethodElectionDate = new AdjustableOrRelativeDate(item); } } } XmlNodeList settlementMethodElectingPartyReferenceNodeList = xmlNode.SelectNodes("settlementMethodElectingPartyReference"); if (settlementMethodElectingPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementMethodElectingPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementMethodElectingPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(settlementMethodElectingPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementMethodElectingPartyReferenceIDRef = item.Attributes["href"].Name; } else { settlementMethodElectingPartyReference = new PartyReference(item); } } } XmlNodeList settlementPriceDefaultElectionNodeList = xmlNode.SelectNodes("settlementPriceDefaultElection"); if (settlementPriceDefaultElectionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementPriceDefaultElectionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementPriceDefaultElectionIDRef = item.Attributes["id"].Name; SettlementPriceDefaultElection ob = SettlementPriceDefaultElection(); IDManager.SetID(settlementPriceDefaultElectionIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementPriceDefaultElectionIDRef = item.Attributes["href"].Name; } else { settlementPriceDefaultElection = new SettlementPriceDefaultElection(item); } } } }
public DirectionalLegUnderlyer(XmlNode xmlNode) : base(xmlNode) { XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer"); if (underlyerNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in underlyerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyerIDRef = item.Attributes["id"].Name; Underlyer ob = Underlyer(); IDManager.SetID(underlyerIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyerIDRef = item.Attributes["href"].Name; } else { underlyer = new Underlyer(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); } } } XmlNodeList fxFeatureNodeList = xmlNode.SelectNodes("fxFeature"); if (fxFeatureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in fxFeatureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fxFeatureIDRef = item.Attributes["id"].Name; FxFeature ob = FxFeature(); IDManager.SetID(fxFeatureIDRef, ob); } else if (item.Attributes.ToString() == "href") { fxFeatureIDRef = item.Attributes["href"].Name; } else { fxFeature = new FxFeature(item); } } } }
public DirectionalLegUnderlyer(XmlNode xmlNode) : base(xmlNode) { XmlNode underlyerNode = xmlNode.SelectSingleNode("underlyer"); if (underlyerNode != null) { if (underlyerNode.Attributes["href"] != null || underlyerNode.Attributes["id"] != null) { if (underlyerNode.Attributes["id"] != null) { underlyerIDRef_ = underlyerNode.Attributes["id"].Value; Underlyer ob = new Underlyer(underlyerNode); IDManager.SetID(underlyerIDRef_, ob); } else if (underlyerNode.Attributes["href"] != null) { underlyerIDRef_ = underlyerNode.Attributes["href"].Value; } else { underlyer_ = new Underlyer(underlyerNode); } } else { underlyer_ = new Underlyer(underlyerNode); } } 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); } } XmlNode fxFeatureNode = xmlNode.SelectSingleNode("fxFeature"); if (fxFeatureNode != null) { if (fxFeatureNode.Attributes["href"] != null || fxFeatureNode.Attributes["id"] != null) { if (fxFeatureNode.Attributes["id"] != null) { fxFeatureIDRef_ = fxFeatureNode.Attributes["id"].Value; FxFeature ob = new FxFeature(fxFeatureNode); IDManager.SetID(fxFeatureIDRef_, ob); } else if (fxFeatureNode.Attributes["href"] != null) { fxFeatureIDRef_ = fxFeatureNode.Attributes["href"].Value; } else { fxFeature_ = new FxFeature(fxFeatureNode); } } else { fxFeature_ = new FxFeature(fxFeatureNode); } } }