public EquityDerivativeBase(XmlNode xmlNode) : base(xmlNode) { XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; EquityOptionTypeEnum ob = EquityOptionTypeEnum(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new EquityOptionTypeEnum(item); } } } XmlNodeList equityEffectiveDateNodeList = xmlNode.SelectNodes("equityEffectiveDate"); if (equityEffectiveDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in equityEffectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityEffectiveDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(equityEffectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityEffectiveDateIDRef = item.Attributes["href"].Name; } else { equityEffectiveDate = new XsdTypeDate(item); } } } 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 notionalNodeList = xmlNode.SelectNodes("notional"); if (notionalNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(notionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalIDRef = item.Attributes["href"].Name; } else { notional = new NonNegativeMoney(item); } } } XmlNodeList equityExerciseNodeList = xmlNode.SelectNodes("equityExercise"); if (equityExerciseNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in equityExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityExerciseIDRef = item.Attributes["id"].Name; EquityExerciseValuationSettlement ob = EquityExerciseValuationSettlement(); IDManager.SetID(equityExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityExerciseIDRef = item.Attributes["href"].Name; } else { equityExercise = new EquityExerciseValuationSettlement(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; OptionFeatures ob = OptionFeatures(); IDManager.SetID(featureIDRef, ob); } else if (item.Attributes.ToString() == "href") { featureIDRef = item.Attributes["href"].Name; } else { feature = new OptionFeatures(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); } } } XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature"); if (strategyFeatureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strategyFeatureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strategyFeatureIDRef = item.Attributes["id"].Name; StrategyFeature ob = StrategyFeature(); IDManager.SetID(strategyFeatureIDRef, ob); } else if (item.Attributes.ToString() == "href") { strategyFeatureIDRef = item.Attributes["href"].Name; } else { strategyFeature = new StrategyFeature(item); } } } }
public EquityDerivativeBase(XmlNode xmlNode) : base(xmlNode) { XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; EquityOptionTypeEnum ob = EquityOptionTypeEnum(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new EquityOptionTypeEnum(item); } } } XmlNodeList equityEffectiveDateNodeList = xmlNode.SelectNodes("equityEffectiveDate"); if (equityEffectiveDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in equityEffectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityEffectiveDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(equityEffectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityEffectiveDateIDRef = item.Attributes["href"].Name; } else { equityEffectiveDate = new XsdTypeDate(item); } } } 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 notionalNodeList = xmlNode.SelectNodes("notional"); if (notionalNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(notionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalIDRef = item.Attributes["href"].Name; } else { notional = new NonNegativeMoney(item); } } } XmlNodeList equityExerciseNodeList = xmlNode.SelectNodes("equityExercise"); if (equityExerciseNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in equityExerciseNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { equityExerciseIDRef = item.Attributes["id"].Name; EquityExerciseValuationSettlement ob = EquityExerciseValuationSettlement(); IDManager.SetID(equityExerciseIDRef, ob); } else if (item.Attributes.ToString() == "href") { equityExerciseIDRef = item.Attributes["href"].Name; } else { equityExercise = new EquityExerciseValuationSettlement(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; OptionFeatures ob = OptionFeatures(); IDManager.SetID(featureIDRef, ob); } else if (item.Attributes.ToString() == "href") { featureIDRef = item.Attributes["href"].Name; } else { feature = new OptionFeatures(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); } } } XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature"); if (strategyFeatureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in strategyFeatureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strategyFeatureIDRef = item.Attributes["id"].Name; StrategyFeature ob = StrategyFeature(); IDManager.SetID(strategyFeatureIDRef, ob); } else if (item.Attributes.ToString() == "href") { strategyFeatureIDRef = item.Attributes["href"].Name; } else { strategyFeature = new StrategyFeature(item); } } } }
public OptionFeature(XmlNode xmlNode) { 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); } } } XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature"); if (strategyFeatureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strategyFeatureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strategyFeatureIDRef = item.Attributes["id"].Name; StrategyFeature ob = StrategyFeature(); IDManager.SetID(strategyFeatureIDRef, ob); } else if (item.Attributes.ToString() == "href") { strategyFeatureIDRef = item.Attributes["href"].Name; } else { strategyFeature = new StrategyFeature(item); } } } XmlNodeList asianNodeList = xmlNode.SelectNodes("asian"); if (asianNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in asianNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { asianIDRef = item.Attributes["id"].Name; Asian ob = Asian(); IDManager.SetID(asianIDRef, ob); } else if (item.Attributes.ToString() == "href") { asianIDRef = item.Attributes["href"].Name; } else { asian = new Asian(item); } } } XmlNodeList barrierNodeList = xmlNode.SelectNodes("barrier"); if (barrierNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in barrierNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { barrierIDRef = item.Attributes["id"].Name; Barrier ob = Barrier(); IDManager.SetID(barrierIDRef, ob); } else if (item.Attributes.ToString() == "href") { barrierIDRef = item.Attributes["href"].Name; } else { barrier = new Barrier(item); } } } XmlNodeList knockNodeList = xmlNode.SelectNodes("knock"); if (knockNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in knockNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { knockIDRef = item.Attributes["id"].Name; Knock ob = Knock(); IDManager.SetID(knockIDRef, ob); } else if (item.Attributes.ToString() == "href") { knockIDRef = item.Attributes["href"].Name; } else { knock = new Knock(item); } } } XmlNodeList passThroughNodeList = xmlNode.SelectNodes("passThrough"); if (passThroughNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in passThroughNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { passThroughIDRef = item.Attributes["id"].Name; PassThrough ob = PassThrough(); IDManager.SetID(passThroughIDRef, ob); } else if (item.Attributes.ToString() == "href") { passThroughIDRef = item.Attributes["href"].Name; } else { passThrough = new PassThrough(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); } } }
public EquityDerivativeBase(XmlNode xmlNode) : base(xmlNode) { XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; EquityOptionTypeEnum ob = new EquityOptionTypeEnum(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new EquityOptionTypeEnum(optionTypeNode); } } else { optionType_ = new EquityOptionTypeEnum(optionTypeNode); } } XmlNode equityEffectiveDateNode = xmlNode.SelectSingleNode("equityEffectiveDate"); if (equityEffectiveDateNode != null) { if (equityEffectiveDateNode.Attributes["href"] != null || equityEffectiveDateNode.Attributes["id"] != null) { if (equityEffectiveDateNode.Attributes["id"] != null) { equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(equityEffectiveDateNode); IDManager.SetID(equityEffectiveDateIDRef_, ob); } else if (equityEffectiveDateNode.Attributes["href"] != null) { equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["href"].Value; } else { equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode); } } else { equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode); } } 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 notionalNode = xmlNode.SelectSingleNode("notional"); if (notionalNode != null) { if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) { if (notionalNode.Attributes["id"] != null) { notionalIDRef_ = notionalNode.Attributes["id"].Value; NonNegativeMoney ob = new NonNegativeMoney(notionalNode); IDManager.SetID(notionalIDRef_, ob); } else if (notionalNode.Attributes["href"] != null) { notionalIDRef_ = notionalNode.Attributes["href"].Value; } else { notional_ = new NonNegativeMoney(notionalNode); } } else { notional_ = new NonNegativeMoney(notionalNode); } } XmlNode equityExerciseNode = xmlNode.SelectSingleNode("equityExercise"); if (equityExerciseNode != null) { if (equityExerciseNode.Attributes["href"] != null || equityExerciseNode.Attributes["id"] != null) { if (equityExerciseNode.Attributes["id"] != null) { equityExerciseIDRef_ = equityExerciseNode.Attributes["id"].Value; EquityExerciseValuationSettlement ob = new EquityExerciseValuationSettlement(equityExerciseNode); IDManager.SetID(equityExerciseIDRef_, ob); } else if (equityExerciseNode.Attributes["href"] != null) { equityExerciseIDRef_ = equityExerciseNode.Attributes["href"].Value; } else { equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode); } } else { equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode); } } 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; OptionFeatures ob = new OptionFeatures(featureNode); IDManager.SetID(featureIDRef_, ob); } else if (featureNode.Attributes["href"] != null) { featureIDRef_ = featureNode.Attributes["href"].Value; } else { feature_ = new OptionFeatures(featureNode); } } else { feature_ = new OptionFeatures(featureNode); } } 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); } } XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature"); if (strategyFeatureNode != null) { if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null) { if (strategyFeatureNode.Attributes["id"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value; StrategyFeature ob = new StrategyFeature(strategyFeatureNode); IDManager.SetID(strategyFeatureIDRef_, ob); } else if (strategyFeatureNode.Attributes["href"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value; } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } }
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) { 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 EquityDerivativeBase(XmlNode xmlNode) : base(xmlNode) { XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; EquityOptionTypeEnum ob = new EquityOptionTypeEnum(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new EquityOptionTypeEnum(optionTypeNode); } } else { optionType_ = new EquityOptionTypeEnum(optionTypeNode); } } XmlNode equityEffectiveDateNode = xmlNode.SelectSingleNode("equityEffectiveDate"); if (equityEffectiveDateNode != null) { if (equityEffectiveDateNode.Attributes["href"] != null || equityEffectiveDateNode.Attributes["id"] != null) { if (equityEffectiveDateNode.Attributes["id"] != null) { equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(equityEffectiveDateNode); IDManager.SetID(equityEffectiveDateIDRef_, ob); } else if (equityEffectiveDateNode.Attributes["href"] != null) { equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["href"].Value; } else { equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode); } } else { equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode); } } 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 notionalNode = xmlNode.SelectSingleNode("notional"); if (notionalNode != null) { if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) { if (notionalNode.Attributes["id"] != null) { notionalIDRef_ = notionalNode.Attributes["id"].Value; NonNegativeMoney ob = new NonNegativeMoney(notionalNode); IDManager.SetID(notionalIDRef_, ob); } else if (notionalNode.Attributes["href"] != null) { notionalIDRef_ = notionalNode.Attributes["href"].Value; } else { notional_ = new NonNegativeMoney(notionalNode); } } else { notional_ = new NonNegativeMoney(notionalNode); } } XmlNode equityExerciseNode = xmlNode.SelectSingleNode("equityExercise"); if (equityExerciseNode != null) { if (equityExerciseNode.Attributes["href"] != null || equityExerciseNode.Attributes["id"] != null) { if (equityExerciseNode.Attributes["id"] != null) { equityExerciseIDRef_ = equityExerciseNode.Attributes["id"].Value; EquityExerciseValuationSettlement ob = new EquityExerciseValuationSettlement(equityExerciseNode); IDManager.SetID(equityExerciseIDRef_, ob); } else if (equityExerciseNode.Attributes["href"] != null) { equityExerciseIDRef_ = equityExerciseNode.Attributes["href"].Value; } else { equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode); } } else { equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode); } } 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; OptionFeatures ob = new OptionFeatures(featureNode); IDManager.SetID(featureIDRef_, ob); } else if (featureNode.Attributes["href"] != null) { featureIDRef_ = featureNode.Attributes["href"].Value; } else { feature_ = new OptionFeatures(featureNode); } } else { feature_ = new OptionFeatures(featureNode); } } 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); } } XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature"); if (strategyFeatureNode != null) { if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null) { if (strategyFeatureNode.Attributes["id"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value; StrategyFeature ob = new StrategyFeature(strategyFeatureNode); IDManager.SetID(strategyFeatureIDRef_, ob); } else if (strategyFeatureNode.Attributes["href"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value; } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } }
public ReturnLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList rateOfReturnNodeList = xmlNode.SelectNodes("rateOfReturn"); if (rateOfReturnNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in rateOfReturnNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateOfReturnIDRef = item.Attributes["id"].Name; ReturnLegValuation ob = ReturnLegValuation(); IDManager.SetID(rateOfReturnIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateOfReturnIDRef = item.Attributes["href"].Name; } else { rateOfReturn = new ReturnLegValuation(item); } } } XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional"); if (notionalNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalIDRef = item.Attributes["id"].Name; ReturnSwapNotional ob = ReturnSwapNotional(); IDManager.SetID(notionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalIDRef = item.Attributes["href"].Name; } else { notional = new ReturnSwapNotional(item); } } } XmlNodeList amountNodeList = xmlNode.SelectNodes("amount"); if (amountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in amountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { amountIDRef = item.Attributes["id"].Name; ReturnSwapAmount ob = ReturnSwapAmount(); IDManager.SetID(amountIDRef, ob); } else if (item.Attributes.ToString() == "href") { amountIDRef = item.Attributes["href"].Name; } else { amount = new ReturnSwapAmount(item); } } } XmlNodeList returnNodeList = xmlNode.SelectNodes("return"); if (returnNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in returnNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { returnIDRef = item.Attributes["id"].Name; Return ob = Return(); IDManager.SetID(returnIDRef, ob); } else if (item.Attributes.ToString() == "href") { returnIDRef = item.Attributes["href"].Name; } else { return( = new Return(item)); } } } XmlNodeList notionalAdjustmentsNodeList = xmlNode.SelectNodes("notionalAdjustments"); if (notionalAdjustmentsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalAdjustmentsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalAdjustmentsIDRef = item.Attributes["id"].Name; NotionalAdjustmentEnum ob = NotionalAdjustmentEnum(); IDManager.SetID(notionalAdjustmentsIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalAdjustmentsIDRef = item.Attributes["href"].Name; } else { notionalAdjustments = new NotionalAdjustmentEnum(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); } } } XmlNodeList averagingDatesNodeList = xmlNode.SelectNodes("averagingDates"); if (averagingDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in averagingDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingDatesIDRef = item.Attributes["id"].Name; AveragingPeriod ob = AveragingPeriod(); IDManager.SetID(averagingDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingDatesIDRef = item.Attributes["href"].Name; } else { averagingDates = new AveragingPeriod(item); } } } }
public ReturnLeg(XmlNode xmlNode) : base(xmlNode) { XmlNode rateOfReturnNode = xmlNode.SelectSingleNode("rateOfReturn"); if (rateOfReturnNode != null) { if (rateOfReturnNode.Attributes["href"] != null || rateOfReturnNode.Attributes["id"] != null) { if (rateOfReturnNode.Attributes["id"] != null) { rateOfReturnIDRef_ = rateOfReturnNode.Attributes["id"].Value; ReturnLegValuation ob = new ReturnLegValuation(rateOfReturnNode); IDManager.SetID(rateOfReturnIDRef_, ob); } else if (rateOfReturnNode.Attributes["href"] != null) { rateOfReturnIDRef_ = rateOfReturnNode.Attributes["href"].Value; } else { rateOfReturn_ = new ReturnLegValuation(rateOfReturnNode); } } else { rateOfReturn_ = new ReturnLegValuation(rateOfReturnNode); } } XmlNode notionalNode = xmlNode.SelectSingleNode("notional"); if (notionalNode != null) { if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) { if (notionalNode.Attributes["id"] != null) { notionalIDRef_ = notionalNode.Attributes["id"].Value; ReturnSwapNotional ob = new ReturnSwapNotional(notionalNode); IDManager.SetID(notionalIDRef_, ob); } else if (notionalNode.Attributes["href"] != null) { notionalIDRef_ = notionalNode.Attributes["href"].Value; } else { notional_ = new ReturnSwapNotional(notionalNode); } } else { notional_ = new ReturnSwapNotional(notionalNode); } } XmlNode amountNode = xmlNode.SelectSingleNode("amount"); if (amountNode != null) { if (amountNode.Attributes["href"] != null || amountNode.Attributes["id"] != null) { if (amountNode.Attributes["id"] != null) { amountIDRef_ = amountNode.Attributes["id"].Value; ReturnSwapAmount ob = new ReturnSwapAmount(amountNode); IDManager.SetID(amountIDRef_, ob); } else if (amountNode.Attributes["href"] != null) { amountIDRef_ = amountNode.Attributes["href"].Value; } else { amount_ = new ReturnSwapAmount(amountNode); } } else { amount_ = new ReturnSwapAmount(amountNode); } } XmlNode returnNode = xmlNode.SelectSingleNode("return"); if (returnNode != null) { if (returnNode.Attributes["href"] != null || returnNode.Attributes["id"] != null) { if (returnNode.Attributes["id"] != null) { returnIDRef_ = returnNode.Attributes["id"].Value; Return ob = new Return(returnNode); IDManager.SetID(returnIDRef_, ob); } else if (returnNode.Attributes["href"] != null) { returnIDRef_ = returnNode.Attributes["href"].Value; } else { return_ = new Return(returnNode); } } else { return_ = new Return(returnNode); } } XmlNode notionalAdjustmentsNode = xmlNode.SelectSingleNode("notionalAdjustments"); if (notionalAdjustmentsNode != null) { if (notionalAdjustmentsNode.Attributes["href"] != null || notionalAdjustmentsNode.Attributes["id"] != null) { if (notionalAdjustmentsNode.Attributes["id"] != null) { notionalAdjustmentsIDRef_ = notionalAdjustmentsNode.Attributes["id"].Value; NotionalAdjustmentEnum ob = new NotionalAdjustmentEnum(notionalAdjustmentsNode); IDManager.SetID(notionalAdjustmentsIDRef_, ob); } else if (notionalAdjustmentsNode.Attributes["href"] != null) { notionalAdjustmentsIDRef_ = notionalAdjustmentsNode.Attributes["href"].Value; } else { notionalAdjustments_ = new NotionalAdjustmentEnum(notionalAdjustmentsNode); } } else { notionalAdjustments_ = new NotionalAdjustmentEnum(notionalAdjustmentsNode); } } 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); } } XmlNode averagingDatesNode = xmlNode.SelectSingleNode("averagingDates"); if (averagingDatesNode != null) { if (averagingDatesNode.Attributes["href"] != null || averagingDatesNode.Attributes["id"] != null) { if (averagingDatesNode.Attributes["id"] != null) { averagingDatesIDRef_ = averagingDatesNode.Attributes["id"].Value; AveragingPeriod ob = new AveragingPeriod(averagingDatesNode); IDManager.SetID(averagingDatesIDRef_, ob); } else if (averagingDatesNode.Attributes["href"] != null) { averagingDatesIDRef_ = averagingDatesNode.Attributes["href"].Value; } else { averagingDates_ = new AveragingPeriod(averagingDatesNode); } } else { averagingDates_ = new AveragingPeriod(averagingDatesNode); } } }
public OptionFeature(XmlNode xmlNode) { 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); } } } XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature"); if (strategyFeatureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in strategyFeatureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strategyFeatureIDRef = item.Attributes["id"].Name; StrategyFeature ob = StrategyFeature(); IDManager.SetID(strategyFeatureIDRef, ob); } else if (item.Attributes.ToString() == "href") { strategyFeatureIDRef = item.Attributes["href"].Name; } else { strategyFeature = new StrategyFeature(item); } } } XmlNodeList asianNodeList = xmlNode.SelectNodes("asian"); if (asianNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in asianNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { asianIDRef = item.Attributes["id"].Name; Asian ob = Asian(); IDManager.SetID(asianIDRef, ob); } else if (item.Attributes.ToString() == "href") { asianIDRef = item.Attributes["href"].Name; } else { asian = new Asian(item); } } } XmlNodeList barrierNodeList = xmlNode.SelectNodes("barrier"); if (barrierNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in barrierNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { barrierIDRef = item.Attributes["id"].Name; Barrier ob = Barrier(); IDManager.SetID(barrierIDRef, ob); } else if (item.Attributes.ToString() == "href") { barrierIDRef = item.Attributes["href"].Name; } else { barrier = new Barrier(item); } } } XmlNodeList knockNodeList = xmlNode.SelectNodes("knock"); if (knockNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in knockNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { knockIDRef = item.Attributes["id"].Name; Knock ob = Knock(); IDManager.SetID(knockIDRef, ob); } else if (item.Attributes.ToString() == "href") { knockIDRef = item.Attributes["href"].Name; } else { knock = new Knock(item); } } } XmlNodeList passThroughNodeList = xmlNode.SelectNodes("passThrough"); if (passThroughNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in passThroughNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { passThroughIDRef = item.Attributes["id"].Name; PassThrough ob = PassThrough(); IDManager.SetID(passThroughIDRef, ob); } else if (item.Attributes.ToString() == "href") { passThroughIDRef = item.Attributes["href"].Name; } else { passThrough = new PassThrough(item); } } } }
public OptionFeature(XmlNode xmlNode) { 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); } } XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature"); if (strategyFeatureNode != null) { if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null) { if (strategyFeatureNode.Attributes["id"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value; StrategyFeature ob = new StrategyFeature(strategyFeatureNode); IDManager.SetID(strategyFeatureIDRef_, ob); } else if (strategyFeatureNode.Attributes["href"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value; } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } XmlNode asianNode = xmlNode.SelectSingleNode("asian"); if (asianNode != null) { if (asianNode.Attributes["href"] != null || asianNode.Attributes["id"] != null) { if (asianNode.Attributes["id"] != null) { asianIDRef_ = asianNode.Attributes["id"].Value; Asian ob = new Asian(asianNode); IDManager.SetID(asianIDRef_, ob); } else if (asianNode.Attributes["href"] != null) { asianIDRef_ = asianNode.Attributes["href"].Value; } else { asian_ = new Asian(asianNode); } } else { asian_ = new Asian(asianNode); } } XmlNode barrierNode = xmlNode.SelectSingleNode("barrier"); if (barrierNode != null) { if (barrierNode.Attributes["href"] != null || barrierNode.Attributes["id"] != null) { if (barrierNode.Attributes["id"] != null) { barrierIDRef_ = barrierNode.Attributes["id"].Value; Barrier ob = new Barrier(barrierNode); IDManager.SetID(barrierIDRef_, ob); } else if (barrierNode.Attributes["href"] != null) { barrierIDRef_ = barrierNode.Attributes["href"].Value; } else { barrier_ = new Barrier(barrierNode); } } else { barrier_ = new Barrier(barrierNode); } } XmlNode knockNode = xmlNode.SelectSingleNode("knock"); if (knockNode != null) { if (knockNode.Attributes["href"] != null || knockNode.Attributes["id"] != null) { if (knockNode.Attributes["id"] != null) { knockIDRef_ = knockNode.Attributes["id"].Value; Knock ob = new Knock(knockNode); IDManager.SetID(knockIDRef_, ob); } else if (knockNode.Attributes["href"] != null) { knockIDRef_ = knockNode.Attributes["href"].Value; } else { knock_ = new Knock(knockNode); } } else { knock_ = new Knock(knockNode); } } XmlNode passThroughNode = xmlNode.SelectSingleNode("passThrough"); if (passThroughNode != null) { if (passThroughNode.Attributes["href"] != null || passThroughNode.Attributes["id"] != null) { if (passThroughNode.Attributes["id"] != null) { passThroughIDRef_ = passThroughNode.Attributes["id"].Value; PassThrough ob = new PassThrough(passThroughNode); IDManager.SetID(passThroughIDRef_, ob); } else if (passThroughNode.Attributes["href"] != null) { passThroughIDRef_ = passThroughNode.Attributes["href"].Value; } else { passThrough_ = new PassThrough(passThroughNode); } } else { passThrough_ = new PassThrough(passThroughNode); } } }
public OptionFeature(XmlNode xmlNode) { 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); } } XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature"); if (strategyFeatureNode != null) { if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null) { if (strategyFeatureNode.Attributes["id"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value; StrategyFeature ob = new StrategyFeature(strategyFeatureNode); IDManager.SetID(strategyFeatureIDRef_, ob); } else if (strategyFeatureNode.Attributes["href"] != null) { strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value; } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } else { strategyFeature_ = new StrategyFeature(strategyFeatureNode); } } XmlNode asianNode = xmlNode.SelectSingleNode("asian"); if (asianNode != null) { if (asianNode.Attributes["href"] != null || asianNode.Attributes["id"] != null) { if (asianNode.Attributes["id"] != null) { asianIDRef_ = asianNode.Attributes["id"].Value; Asian ob = new Asian(asianNode); IDManager.SetID(asianIDRef_, ob); } else if (asianNode.Attributes["href"] != null) { asianIDRef_ = asianNode.Attributes["href"].Value; } else { asian_ = new Asian(asianNode); } } else { asian_ = new Asian(asianNode); } } XmlNode barrierNode = xmlNode.SelectSingleNode("barrier"); if (barrierNode != null) { if (barrierNode.Attributes["href"] != null || barrierNode.Attributes["id"] != null) { if (barrierNode.Attributes["id"] != null) { barrierIDRef_ = barrierNode.Attributes["id"].Value; Barrier ob = new Barrier(barrierNode); IDManager.SetID(barrierIDRef_, ob); } else if (barrierNode.Attributes["href"] != null) { barrierIDRef_ = barrierNode.Attributes["href"].Value; } else { barrier_ = new Barrier(barrierNode); } } else { barrier_ = new Barrier(barrierNode); } } XmlNode knockNode = xmlNode.SelectSingleNode("knock"); if (knockNode != null) { if (knockNode.Attributes["href"] != null || knockNode.Attributes["id"] != null) { if (knockNode.Attributes["id"] != null) { knockIDRef_ = knockNode.Attributes["id"].Value; Knock ob = new Knock(knockNode); IDManager.SetID(knockIDRef_, ob); } else if (knockNode.Attributes["href"] != null) { knockIDRef_ = knockNode.Attributes["href"].Value; } else { knock_ = new Knock(knockNode); } } else { knock_ = new Knock(knockNode); } } XmlNode passThroughNode = xmlNode.SelectSingleNode("passThrough"); if (passThroughNode != null) { if (passThroughNode.Attributes["href"] != null || passThroughNode.Attributes["id"] != null) { if (passThroughNode.Attributes["id"] != null) { passThroughIDRef_ = passThroughNode.Attributes["id"].Value; PassThrough ob = new PassThrough(passThroughNode); IDManager.SetID(passThroughIDRef_, ob); } else if (passThroughNode.Attributes["href"] != null) { passThroughIDRef_ = passThroughNode.Attributes["href"].Value; } else { passThrough_ = new PassThrough(passThroughNode); } } else { passThrough_ = new PassThrough(passThroughNode); } } }
public ReturnLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList rateOfReturnNodeList = xmlNode.SelectNodes("rateOfReturn"); if (rateOfReturnNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in rateOfReturnNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateOfReturnIDRef = item.Attributes["id"].Name; ReturnLegValuation ob = ReturnLegValuation(); IDManager.SetID(rateOfReturnIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateOfReturnIDRef = item.Attributes["href"].Name; } else { rateOfReturn = new ReturnLegValuation(item); } } } XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional"); if (notionalNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalIDRef = item.Attributes["id"].Name; ReturnSwapNotional ob = ReturnSwapNotional(); IDManager.SetID(notionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalIDRef = item.Attributes["href"].Name; } else { notional = new ReturnSwapNotional(item); } } } XmlNodeList amountNodeList = xmlNode.SelectNodes("amount"); if (amountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in amountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { amountIDRef = item.Attributes["id"].Name; ReturnSwapAmount ob = ReturnSwapAmount(); IDManager.SetID(amountIDRef, ob); } else if (item.Attributes.ToString() == "href") { amountIDRef = item.Attributes["href"].Name; } else { amount = new ReturnSwapAmount(item); } } } XmlNodeList returnNodeList = xmlNode.SelectNodes("return"); if (returnNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in returnNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { returnIDRef = item.Attributes["id"].Name; Return ob = Return(); IDManager.SetID(returnIDRef, ob); } else if (item.Attributes.ToString() == "href") { returnIDRef = item.Attributes["href"].Name; } else { return = new Return(item); } } } XmlNodeList notionalAdjustmentsNodeList = xmlNode.SelectNodes("notionalAdjustments"); if (notionalAdjustmentsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalAdjustmentsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalAdjustmentsIDRef = item.Attributes["id"].Name; NotionalAdjustmentEnum ob = NotionalAdjustmentEnum(); IDManager.SetID(notionalAdjustmentsIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalAdjustmentsIDRef = item.Attributes["href"].Name; } else { notionalAdjustments = new NotionalAdjustmentEnum(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); } } } XmlNodeList averagingDatesNodeList = xmlNode.SelectNodes("averagingDates"); if (averagingDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in averagingDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingDatesIDRef = item.Attributes["id"].Name; AveragingPeriod ob = AveragingPeriod(); IDManager.SetID(averagingDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingDatesIDRef = item.Attributes["href"].Name; } else { averagingDates = new AveragingPeriod(item); } } } }
public ReturnLeg(XmlNode xmlNode) : base(xmlNode) { XmlNode rateOfReturnNode = xmlNode.SelectSingleNode("rateOfReturn"); if (rateOfReturnNode != null) { if (rateOfReturnNode.Attributes["href"] != null || rateOfReturnNode.Attributes["id"] != null) { if (rateOfReturnNode.Attributes["id"] != null) { rateOfReturnIDRef_ = rateOfReturnNode.Attributes["id"].Value; ReturnLegValuation ob = new ReturnLegValuation(rateOfReturnNode); IDManager.SetID(rateOfReturnIDRef_, ob); } else if (rateOfReturnNode.Attributes["href"] != null) { rateOfReturnIDRef_ = rateOfReturnNode.Attributes["href"].Value; } else { rateOfReturn_ = new ReturnLegValuation(rateOfReturnNode); } } else { rateOfReturn_ = new ReturnLegValuation(rateOfReturnNode); } } XmlNode notionalNode = xmlNode.SelectSingleNode("notional"); if (notionalNode != null) { if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) { if (notionalNode.Attributes["id"] != null) { notionalIDRef_ = notionalNode.Attributes["id"].Value; ReturnSwapNotional ob = new ReturnSwapNotional(notionalNode); IDManager.SetID(notionalIDRef_, ob); } else if (notionalNode.Attributes["href"] != null) { notionalIDRef_ = notionalNode.Attributes["href"].Value; } else { notional_ = new ReturnSwapNotional(notionalNode); } } else { notional_ = new ReturnSwapNotional(notionalNode); } } XmlNode amountNode = xmlNode.SelectSingleNode("amount"); if (amountNode != null) { if (amountNode.Attributes["href"] != null || amountNode.Attributes["id"] != null) { if (amountNode.Attributes["id"] != null) { amountIDRef_ = amountNode.Attributes["id"].Value; ReturnSwapAmount ob = new ReturnSwapAmount(amountNode); IDManager.SetID(amountIDRef_, ob); } else if (amountNode.Attributes["href"] != null) { amountIDRef_ = amountNode.Attributes["href"].Value; } else { amount_ = new ReturnSwapAmount(amountNode); } } else { amount_ = new ReturnSwapAmount(amountNode); } } XmlNode returnNode = xmlNode.SelectSingleNode("return"); if (returnNode != null) { if (returnNode.Attributes["href"] != null || returnNode.Attributes["id"] != null) { if (returnNode.Attributes["id"] != null) { returnIDRef_ = returnNode.Attributes["id"].Value; Return ob = new Return(returnNode); IDManager.SetID(returnIDRef_, ob); } else if (returnNode.Attributes["href"] != null) { returnIDRef_ = returnNode.Attributes["href"].Value; } else { return_ = new Return(returnNode); } } else { return_ = new Return(returnNode); } } XmlNode notionalAdjustmentsNode = xmlNode.SelectSingleNode("notionalAdjustments"); if (notionalAdjustmentsNode != null) { if (notionalAdjustmentsNode.Attributes["href"] != null || notionalAdjustmentsNode.Attributes["id"] != null) { if (notionalAdjustmentsNode.Attributes["id"] != null) { notionalAdjustmentsIDRef_ = notionalAdjustmentsNode.Attributes["id"].Value; NotionalAdjustmentEnum ob = new NotionalAdjustmentEnum(notionalAdjustmentsNode); IDManager.SetID(notionalAdjustmentsIDRef_, ob); } else if (notionalAdjustmentsNode.Attributes["href"] != null) { notionalAdjustmentsIDRef_ = notionalAdjustmentsNode.Attributes["href"].Value; } else { notionalAdjustments_ = new NotionalAdjustmentEnum(notionalAdjustmentsNode); } } else { notionalAdjustments_ = new NotionalAdjustmentEnum(notionalAdjustmentsNode); } } 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); } } XmlNode averagingDatesNode = xmlNode.SelectSingleNode("averagingDates"); if (averagingDatesNode != null) { if (averagingDatesNode.Attributes["href"] != null || averagingDatesNode.Attributes["id"] != null) { if (averagingDatesNode.Attributes["id"] != null) { averagingDatesIDRef_ = averagingDatesNode.Attributes["id"].Value; AveragingPeriod ob = new AveragingPeriod(averagingDatesNode); IDManager.SetID(averagingDatesIDRef_, ob); } else if (averagingDatesNode.Attributes["href"] != null) { averagingDatesIDRef_ = averagingDatesNode.Attributes["href"].Value; } else { averagingDates_ = new AveragingPeriod(averagingDatesNode); } } else { averagingDates_ = new AveragingPeriod(averagingDatesNode); } } }
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); } } }