public Swap(XmlNode xmlNode) : base(xmlNode) { XmlNodeList swapStreamNodeList = xmlNode.SelectNodes("swapStream"); foreach (XmlNode item in swapStreamNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swapStreamIDRef = item.Attributes["id"].Name; List<InterestRateStream> ob = new List<InterestRateStream>(); ob.Add(new InterestRateStream(item)); IDManager.SetID(swapStreamIDRef, ob); } else if (item.Attributes.ToString() == "href") { swapStreamIDRef = item.Attributes["href"].Name; } else { swapStream.Add(new InterestRateStream(item)); } } } XmlNodeList earlyTerminationProvisionNodeList = xmlNode.SelectNodes("earlyTerminationProvision"); if (earlyTerminationProvisionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in earlyTerminationProvisionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { earlyTerminationProvisionIDRef = item.Attributes["id"].Name; EarlyTerminationProvision ob = EarlyTerminationProvision(); IDManager.SetID(earlyTerminationProvisionIDRef, ob); } else if (item.Attributes.ToString() == "href") { earlyTerminationProvisionIDRef = item.Attributes["href"].Name; } else { earlyTerminationProvision = new EarlyTerminationProvision(item); } } } XmlNodeList cancelableProvisionNodeList = xmlNode.SelectNodes("cancelableProvision"); if (cancelableProvisionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cancelableProvisionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cancelableProvisionIDRef = item.Attributes["id"].Name; CancelableProvision ob = CancelableProvision(); IDManager.SetID(cancelableProvisionIDRef, ob); } else if (item.Attributes.ToString() == "href") { cancelableProvisionIDRef = item.Attributes["href"].Name; } else { cancelableProvision = new CancelableProvision(item); } } } XmlNodeList extendibleProvisionNodeList = xmlNode.SelectNodes("extendibleProvision"); if (extendibleProvisionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in extendibleProvisionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { extendibleProvisionIDRef = item.Attributes["id"].Name; ExtendibleProvision ob = ExtendibleProvision(); IDManager.SetID(extendibleProvisionIDRef, ob); } else if (item.Attributes.ToString() == "href") { extendibleProvisionIDRef = item.Attributes["href"].Name; } else { extendibleProvision = new ExtendibleProvision(item); } } } XmlNodeList additionalPaymentNodeList = xmlNode.SelectNodes("additionalPayment"); foreach (XmlNode item in additionalPaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { additionalPaymentIDRef = item.Attributes["id"].Name; List<Payment> ob = new List<Payment>(); ob.Add(new Payment(item)); IDManager.SetID(additionalPaymentIDRef, ob); } else if (item.Attributes.ToString() == "href") { additionalPaymentIDRef = item.Attributes["href"].Name; } else { additionalPayment.Add(new Payment(item)); } } } XmlNodeList additionalTermsNodeList = xmlNode.SelectNodes("additionalTerms"); if (additionalTermsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in additionalTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { additionalTermsIDRef = item.Attributes["id"].Name; SwapAdditionalTerms ob = SwapAdditionalTerms(); IDManager.SetID(additionalTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { additionalTermsIDRef = item.Attributes["href"].Name; } else { additionalTerms = new SwapAdditionalTerms(item); } } } }
public Swap(XmlNode xmlNode) : base(xmlNode) { XmlNodeList swapStreamNodeList = xmlNode.SelectNodes("swapStream"); if (swapStreamNodeList != null) { this.swapStream_ = new List<InterestRateStream>(); foreach (XmlNode item in swapStreamNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { swapStreamIDRef_ = item.Attributes["id"].Value; swapStream_.Add(new InterestRateStream(item)); IDManager.SetID(swapStreamIDRef_, swapStream_[swapStream_.Count - 1 ]); } else if (item.Attributes["href"] != null) { swapStreamIDRef_ = item.Attributes["href"].Value; } else { swapStream_.Add(new InterestRateStream(item)); } } else { swapStream_.Add(new InterestRateStream(item)); } } } XmlNode earlyTerminationProvisionNode = xmlNode.SelectSingleNode("earlyTerminationProvision"); if (earlyTerminationProvisionNode != null) { if (earlyTerminationProvisionNode.Attributes["href"] != null || earlyTerminationProvisionNode.Attributes["id"] != null) { if (earlyTerminationProvisionNode.Attributes["id"] != null) { earlyTerminationProvisionIDRef_ = earlyTerminationProvisionNode.Attributes["id"].Value; EarlyTerminationProvision ob = new EarlyTerminationProvision(earlyTerminationProvisionNode); IDManager.SetID(earlyTerminationProvisionIDRef_, ob); } else if (earlyTerminationProvisionNode.Attributes["href"] != null) { earlyTerminationProvisionIDRef_ = earlyTerminationProvisionNode.Attributes["href"].Value; } else { earlyTerminationProvision_ = new EarlyTerminationProvision(earlyTerminationProvisionNode); } } else { earlyTerminationProvision_ = new EarlyTerminationProvision(earlyTerminationProvisionNode); } } XmlNode cancelableProvisionNode = xmlNode.SelectSingleNode("cancelableProvision"); if (cancelableProvisionNode != null) { if (cancelableProvisionNode.Attributes["href"] != null || cancelableProvisionNode.Attributes["id"] != null) { if (cancelableProvisionNode.Attributes["id"] != null) { cancelableProvisionIDRef_ = cancelableProvisionNode.Attributes["id"].Value; CancelableProvision ob = new CancelableProvision(cancelableProvisionNode); IDManager.SetID(cancelableProvisionIDRef_, ob); } else if (cancelableProvisionNode.Attributes["href"] != null) { cancelableProvisionIDRef_ = cancelableProvisionNode.Attributes["href"].Value; } else { cancelableProvision_ = new CancelableProvision(cancelableProvisionNode); } } else { cancelableProvision_ = new CancelableProvision(cancelableProvisionNode); } } XmlNode extendibleProvisionNode = xmlNode.SelectSingleNode("extendibleProvision"); if (extendibleProvisionNode != null) { if (extendibleProvisionNode.Attributes["href"] != null || extendibleProvisionNode.Attributes["id"] != null) { if (extendibleProvisionNode.Attributes["id"] != null) { extendibleProvisionIDRef_ = extendibleProvisionNode.Attributes["id"].Value; ExtendibleProvision ob = new ExtendibleProvision(extendibleProvisionNode); IDManager.SetID(extendibleProvisionIDRef_, ob); } else if (extendibleProvisionNode.Attributes["href"] != null) { extendibleProvisionIDRef_ = extendibleProvisionNode.Attributes["href"].Value; } else { extendibleProvision_ = new ExtendibleProvision(extendibleProvisionNode); } } else { extendibleProvision_ = new ExtendibleProvision(extendibleProvisionNode); } } XmlNodeList additionalPaymentNodeList = xmlNode.SelectNodes("additionalPayment"); if (additionalPaymentNodeList != null) { this.additionalPayment_ = new List<Payment>(); foreach (XmlNode item in additionalPaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { additionalPaymentIDRef_ = item.Attributes["id"].Value; additionalPayment_.Add(new Payment(item)); IDManager.SetID(additionalPaymentIDRef_, additionalPayment_[additionalPayment_.Count - 1 ]); } else if (item.Attributes["href"] != null) { additionalPaymentIDRef_ = item.Attributes["href"].Value; } else { additionalPayment_.Add(new Payment(item)); } } else { additionalPayment_.Add(new Payment(item)); } } } XmlNode additionalTermsNode = xmlNode.SelectSingleNode("additionalTerms"); if (additionalTermsNode != null) { if (additionalTermsNode.Attributes["href"] != null || additionalTermsNode.Attributes["id"] != null) { if (additionalTermsNode.Attributes["id"] != null) { additionalTermsIDRef_ = additionalTermsNode.Attributes["id"].Value; SwapAdditionalTerms ob = new SwapAdditionalTerms(additionalTermsNode); IDManager.SetID(additionalTermsIDRef_, ob); } else if (additionalTermsNode.Attributes["href"] != null) { additionalTermsIDRef_ = additionalTermsNode.Attributes["href"].Value; } else { additionalTerms_ = new SwapAdditionalTerms(additionalTermsNode); } } else { additionalTerms_ = new SwapAdditionalTerms(additionalTermsNode); } } }
public Swap(XmlNode xmlNode) : base(xmlNode) { XmlNodeList swapStreamNodeList = xmlNode.SelectNodes("swapStream"); foreach (XmlNode item in swapStreamNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { swapStreamIDRef = item.Attributes["id"].Name; List <InterestRateStream> ob = new List <InterestRateStream>(); ob.Add(new InterestRateStream(item)); IDManager.SetID(swapStreamIDRef, ob); } else if (item.Attributes.ToString() == "href") { swapStreamIDRef = item.Attributes["href"].Name; } else { swapStream.Add(new InterestRateStream(item)); } } } XmlNodeList earlyTerminationProvisionNodeList = xmlNode.SelectNodes("earlyTerminationProvision"); if (earlyTerminationProvisionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in earlyTerminationProvisionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { earlyTerminationProvisionIDRef = item.Attributes["id"].Name; EarlyTerminationProvision ob = EarlyTerminationProvision(); IDManager.SetID(earlyTerminationProvisionIDRef, ob); } else if (item.Attributes.ToString() == "href") { earlyTerminationProvisionIDRef = item.Attributes["href"].Name; } else { earlyTerminationProvision = new EarlyTerminationProvision(item); } } } XmlNodeList cancelableProvisionNodeList = xmlNode.SelectNodes("cancelableProvision"); if (cancelableProvisionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in cancelableProvisionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cancelableProvisionIDRef = item.Attributes["id"].Name; CancelableProvision ob = CancelableProvision(); IDManager.SetID(cancelableProvisionIDRef, ob); } else if (item.Attributes.ToString() == "href") { cancelableProvisionIDRef = item.Attributes["href"].Name; } else { cancelableProvision = new CancelableProvision(item); } } } XmlNodeList extendibleProvisionNodeList = xmlNode.SelectNodes("extendibleProvision"); if (extendibleProvisionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in extendibleProvisionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { extendibleProvisionIDRef = item.Attributes["id"].Name; ExtendibleProvision ob = ExtendibleProvision(); IDManager.SetID(extendibleProvisionIDRef, ob); } else if (item.Attributes.ToString() == "href") { extendibleProvisionIDRef = item.Attributes["href"].Name; } else { extendibleProvision = new ExtendibleProvision(item); } } } XmlNodeList additionalPaymentNodeList = xmlNode.SelectNodes("additionalPayment"); foreach (XmlNode item in additionalPaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { additionalPaymentIDRef = item.Attributes["id"].Name; List <Payment> ob = new List <Payment>(); ob.Add(new Payment(item)); IDManager.SetID(additionalPaymentIDRef, ob); } else if (item.Attributes.ToString() == "href") { additionalPaymentIDRef = item.Attributes["href"].Name; } else { additionalPayment.Add(new Payment(item)); } } } XmlNodeList additionalTermsNodeList = xmlNode.SelectNodes("additionalTerms"); if (additionalTermsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in additionalTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { additionalTermsIDRef = item.Attributes["id"].Name; SwapAdditionalTerms ob = SwapAdditionalTerms(); IDManager.SetID(additionalTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { additionalTermsIDRef = item.Attributes["href"].Name; } else { additionalTerms = new SwapAdditionalTerms(item); } } } }
public Swap(XmlNode xmlNode) : base(xmlNode) { XmlNodeList swapStreamNodeList = xmlNode.SelectNodes("swapStream"); if (swapStreamNodeList != null) { this.swapStream_ = new List <InterestRateStream>(); foreach (XmlNode item in swapStreamNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { swapStreamIDRef_ = item.Attributes["id"].Value; swapStream_.Add(new InterestRateStream(item)); IDManager.SetID(swapStreamIDRef_, swapStream_[swapStream_.Count - 1]); } else if (item.Attributes["href"] != null) { swapStreamIDRef_ = item.Attributes["href"].Value; } else { swapStream_.Add(new InterestRateStream(item)); } } else { swapStream_.Add(new InterestRateStream(item)); } } } XmlNode earlyTerminationProvisionNode = xmlNode.SelectSingleNode("earlyTerminationProvision"); if (earlyTerminationProvisionNode != null) { if (earlyTerminationProvisionNode.Attributes["href"] != null || earlyTerminationProvisionNode.Attributes["id"] != null) { if (earlyTerminationProvisionNode.Attributes["id"] != null) { earlyTerminationProvisionIDRef_ = earlyTerminationProvisionNode.Attributes["id"].Value; EarlyTerminationProvision ob = new EarlyTerminationProvision(earlyTerminationProvisionNode); IDManager.SetID(earlyTerminationProvisionIDRef_, ob); } else if (earlyTerminationProvisionNode.Attributes["href"] != null) { earlyTerminationProvisionIDRef_ = earlyTerminationProvisionNode.Attributes["href"].Value; } else { earlyTerminationProvision_ = new EarlyTerminationProvision(earlyTerminationProvisionNode); } } else { earlyTerminationProvision_ = new EarlyTerminationProvision(earlyTerminationProvisionNode); } } XmlNode cancelableProvisionNode = xmlNode.SelectSingleNode("cancelableProvision"); if (cancelableProvisionNode != null) { if (cancelableProvisionNode.Attributes["href"] != null || cancelableProvisionNode.Attributes["id"] != null) { if (cancelableProvisionNode.Attributes["id"] != null) { cancelableProvisionIDRef_ = cancelableProvisionNode.Attributes["id"].Value; CancelableProvision ob = new CancelableProvision(cancelableProvisionNode); IDManager.SetID(cancelableProvisionIDRef_, ob); } else if (cancelableProvisionNode.Attributes["href"] != null) { cancelableProvisionIDRef_ = cancelableProvisionNode.Attributes["href"].Value; } else { cancelableProvision_ = new CancelableProvision(cancelableProvisionNode); } } else { cancelableProvision_ = new CancelableProvision(cancelableProvisionNode); } } XmlNode extendibleProvisionNode = xmlNode.SelectSingleNode("extendibleProvision"); if (extendibleProvisionNode != null) { if (extendibleProvisionNode.Attributes["href"] != null || extendibleProvisionNode.Attributes["id"] != null) { if (extendibleProvisionNode.Attributes["id"] != null) { extendibleProvisionIDRef_ = extendibleProvisionNode.Attributes["id"].Value; ExtendibleProvision ob = new ExtendibleProvision(extendibleProvisionNode); IDManager.SetID(extendibleProvisionIDRef_, ob); } else if (extendibleProvisionNode.Attributes["href"] != null) { extendibleProvisionIDRef_ = extendibleProvisionNode.Attributes["href"].Value; } else { extendibleProvision_ = new ExtendibleProvision(extendibleProvisionNode); } } else { extendibleProvision_ = new ExtendibleProvision(extendibleProvisionNode); } } XmlNodeList additionalPaymentNodeList = xmlNode.SelectNodes("additionalPayment"); if (additionalPaymentNodeList != null) { this.additionalPayment_ = new List <Payment>(); foreach (XmlNode item in additionalPaymentNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { additionalPaymentIDRef_ = item.Attributes["id"].Value; additionalPayment_.Add(new Payment(item)); IDManager.SetID(additionalPaymentIDRef_, additionalPayment_[additionalPayment_.Count - 1]); } else if (item.Attributes["href"] != null) { additionalPaymentIDRef_ = item.Attributes["href"].Value; } else { additionalPayment_.Add(new Payment(item)); } } else { additionalPayment_.Add(new Payment(item)); } } } XmlNode additionalTermsNode = xmlNode.SelectSingleNode("additionalTerms"); if (additionalTermsNode != null) { if (additionalTermsNode.Attributes["href"] != null || additionalTermsNode.Attributes["id"] != null) { if (additionalTermsNode.Attributes["id"] != null) { additionalTermsIDRef_ = additionalTermsNode.Attributes["id"].Value; SwapAdditionalTerms ob = new SwapAdditionalTerms(additionalTermsNode); IDManager.SetID(additionalTermsIDRef_, ob); } else if (additionalTermsNode.Attributes["href"] != null) { additionalTermsIDRef_ = additionalTermsNode.Attributes["href"].Value; } else { additionalTerms_ = new SwapAdditionalTerms(additionalTermsNode); } } else { additionalTerms_ = new SwapAdditionalTerms(additionalTermsNode); } } }