public CreditDefaultSwap(XmlNode xmlNode) : base(xmlNode) { XmlNodeList generalTermsNodeList = xmlNode.SelectNodes("generalTerms"); if (generalTermsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in generalTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { generalTermsIDRef = item.Attributes["id"].Name; GeneralTerms ob = GeneralTerms(); IDManager.SetID(generalTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { generalTermsIDRef = item.Attributes["href"].Name; } else { generalTerms = new GeneralTerms(item); } } } XmlNodeList feeLegNodeList = xmlNode.SelectNodes("feeLeg"); if (feeLegNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in feeLegNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { feeLegIDRef = item.Attributes["id"].Name; FeeLeg ob = FeeLeg(); IDManager.SetID(feeLegIDRef, ob); } else if (item.Attributes.ToString() == "href") { feeLegIDRef = item.Attributes["href"].Name; } else { feeLeg = new FeeLeg(item); } } } XmlNodeList protectionTermsNodeList = xmlNode.SelectNodes("protectionTerms"); foreach (XmlNode item in protectionTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { protectionTermsIDRef = item.Attributes["id"].Name; List <ProtectionTerms> ob = new List <ProtectionTerms>(); ob.Add(new ProtectionTerms(item)); IDManager.SetID(protectionTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { protectionTermsIDRef = item.Attributes["href"].Name; } else { protectionTerms.Add(new ProtectionTerms(item)); } } } XmlNodeList cashSettlementTermsNodeList = xmlNode.SelectNodes("cashSettlementTerms"); if (cashSettlementTermsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in cashSettlementTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashSettlementTermsIDRef = item.Attributes["id"].Name; CashSettlementTerms ob = CashSettlementTerms(); IDManager.SetID(cashSettlementTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementTermsIDRef = item.Attributes["href"].Name; } else { cashSettlementTerms = new CashSettlementTerms(item); } } } XmlNodeList physicalSettlementTermsNodeList = xmlNode.SelectNodes("physicalSettlementTerms"); if (physicalSettlementTermsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in physicalSettlementTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalSettlementTermsIDRef = item.Attributes["id"].Name; PhysicalSettlementTerms ob = PhysicalSettlementTerms(); IDManager.SetID(physicalSettlementTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalSettlementTermsIDRef = item.Attributes["href"].Name; } else { physicalSettlementTerms = new PhysicalSettlementTerms(item); } } } }
public CreditDefaultSwap(XmlNode xmlNode) : base(xmlNode) { XmlNode generalTermsNode = xmlNode.SelectSingleNode("generalTerms"); if (generalTermsNode != null) { if (generalTermsNode.Attributes["href"] != null || generalTermsNode.Attributes["id"] != null) { if (generalTermsNode.Attributes["id"] != null) { generalTermsIDRef_ = generalTermsNode.Attributes["id"].Value; GeneralTerms ob = new GeneralTerms(generalTermsNode); IDManager.SetID(generalTermsIDRef_, ob); } else if (generalTermsNode.Attributes["href"] != null) { generalTermsIDRef_ = generalTermsNode.Attributes["href"].Value; } else { generalTerms_ = new GeneralTerms(generalTermsNode); } } else { generalTerms_ = new GeneralTerms(generalTermsNode); } } XmlNode feeLegNode = xmlNode.SelectSingleNode("feeLeg"); if (feeLegNode != null) { if (feeLegNode.Attributes["href"] != null || feeLegNode.Attributes["id"] != null) { if (feeLegNode.Attributes["id"] != null) { feeLegIDRef_ = feeLegNode.Attributes["id"].Value; FeeLeg ob = new FeeLeg(feeLegNode); IDManager.SetID(feeLegIDRef_, ob); } else if (feeLegNode.Attributes["href"] != null) { feeLegIDRef_ = feeLegNode.Attributes["href"].Value; } else { feeLeg_ = new FeeLeg(feeLegNode); } } else { feeLeg_ = new FeeLeg(feeLegNode); } } XmlNodeList protectionTermsNodeList = xmlNode.SelectNodes("protectionTerms"); if (protectionTermsNodeList != null) { this.protectionTerms_ = new List <ProtectionTerms>(); foreach (XmlNode item in protectionTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { protectionTermsIDRef_ = item.Attributes["id"].Value; protectionTerms_.Add(new ProtectionTerms(item)); IDManager.SetID(protectionTermsIDRef_, protectionTerms_[protectionTerms_.Count - 1]); } else if (item.Attributes["href"] != null) { protectionTermsIDRef_ = item.Attributes["href"].Value; } else { protectionTerms_.Add(new ProtectionTerms(item)); } } else { protectionTerms_.Add(new ProtectionTerms(item)); } } } XmlNode cashSettlementTermsNode = xmlNode.SelectSingleNode("cashSettlementTerms"); if (cashSettlementTermsNode != null) { if (cashSettlementTermsNode.Attributes["href"] != null || cashSettlementTermsNode.Attributes["id"] != null) { if (cashSettlementTermsNode.Attributes["id"] != null) { cashSettlementTermsIDRef_ = cashSettlementTermsNode.Attributes["id"].Value; CashSettlementTerms ob = new CashSettlementTerms(cashSettlementTermsNode); IDManager.SetID(cashSettlementTermsIDRef_, ob); } else if (cashSettlementTermsNode.Attributes["href"] != null) { cashSettlementTermsIDRef_ = cashSettlementTermsNode.Attributes["href"].Value; } else { cashSettlementTerms_ = new CashSettlementTerms(cashSettlementTermsNode); } } else { cashSettlementTerms_ = new CashSettlementTerms(cashSettlementTermsNode); } } XmlNode physicalSettlementTermsNode = xmlNode.SelectSingleNode("physicalSettlementTerms"); if (physicalSettlementTermsNode != null) { if (physicalSettlementTermsNode.Attributes["href"] != null || physicalSettlementTermsNode.Attributes["id"] != null) { if (physicalSettlementTermsNode.Attributes["id"] != null) { physicalSettlementTermsIDRef_ = physicalSettlementTermsNode.Attributes["id"].Value; PhysicalSettlementTerms ob = new PhysicalSettlementTerms(physicalSettlementTermsNode); IDManager.SetID(physicalSettlementTermsIDRef_, ob); } else if (physicalSettlementTermsNode.Attributes["href"] != null) { physicalSettlementTermsIDRef_ = physicalSettlementTermsNode.Attributes["href"].Value; } else { physicalSettlementTerms_ = new PhysicalSettlementTerms(physicalSettlementTermsNode); } } else { physicalSettlementTerms_ = new PhysicalSettlementTerms(physicalSettlementTermsNode); } } }
public CreditDefaultSwap(XmlNode xmlNode) : base(xmlNode) { XmlNodeList generalTermsNodeList = xmlNode.SelectNodes("generalTerms"); if (generalTermsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in generalTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { generalTermsIDRef = item.Attributes["id"].Name; GeneralTerms ob = GeneralTerms(); IDManager.SetID(generalTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { generalTermsIDRef = item.Attributes["href"].Name; } else { generalTerms = new GeneralTerms(item); } } } XmlNodeList feeLegNodeList = xmlNode.SelectNodes("feeLeg"); if (feeLegNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in feeLegNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { feeLegIDRef = item.Attributes["id"].Name; FeeLeg ob = FeeLeg(); IDManager.SetID(feeLegIDRef, ob); } else if (item.Attributes.ToString() == "href") { feeLegIDRef = item.Attributes["href"].Name; } else { feeLeg = new FeeLeg(item); } } } XmlNodeList protectionTermsNodeList = xmlNode.SelectNodes("protectionTerms"); foreach (XmlNode item in protectionTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { protectionTermsIDRef = item.Attributes["id"].Name; List<ProtectionTerms> ob = new List<ProtectionTerms>(); ob.Add(new ProtectionTerms(item)); IDManager.SetID(protectionTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { protectionTermsIDRef = item.Attributes["href"].Name; } else { protectionTerms.Add(new ProtectionTerms(item)); } } } XmlNodeList cashSettlementTermsNodeList = xmlNode.SelectNodes("cashSettlementTerms"); if (cashSettlementTermsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in cashSettlementTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cashSettlementTermsIDRef = item.Attributes["id"].Name; CashSettlementTerms ob = CashSettlementTerms(); IDManager.SetID(cashSettlementTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { cashSettlementTermsIDRef = item.Attributes["href"].Name; } else { cashSettlementTerms = new CashSettlementTerms(item); } } } XmlNodeList physicalSettlementTermsNodeList = xmlNode.SelectNodes("physicalSettlementTerms"); if (physicalSettlementTermsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in physicalSettlementTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { physicalSettlementTermsIDRef = item.Attributes["id"].Name; PhysicalSettlementTerms ob = PhysicalSettlementTerms(); IDManager.SetID(physicalSettlementTermsIDRef, ob); } else if (item.Attributes.ToString() == "href") { physicalSettlementTermsIDRef = item.Attributes["href"].Name; } else { physicalSettlementTerms = new PhysicalSettlementTerms(item); } } } }
public CreditDefaultSwap(XmlNode xmlNode) : base(xmlNode) { XmlNode generalTermsNode = xmlNode.SelectSingleNode("generalTerms"); if (generalTermsNode != null) { if (generalTermsNode.Attributes["href"] != null || generalTermsNode.Attributes["id"] != null) { if (generalTermsNode.Attributes["id"] != null) { generalTermsIDRef_ = generalTermsNode.Attributes["id"].Value; GeneralTerms ob = new GeneralTerms(generalTermsNode); IDManager.SetID(generalTermsIDRef_, ob); } else if (generalTermsNode.Attributes["href"] != null) { generalTermsIDRef_ = generalTermsNode.Attributes["href"].Value; } else { generalTerms_ = new GeneralTerms(generalTermsNode); } } else { generalTerms_ = new GeneralTerms(generalTermsNode); } } XmlNode feeLegNode = xmlNode.SelectSingleNode("feeLeg"); if (feeLegNode != null) { if (feeLegNode.Attributes["href"] != null || feeLegNode.Attributes["id"] != null) { if (feeLegNode.Attributes["id"] != null) { feeLegIDRef_ = feeLegNode.Attributes["id"].Value; FeeLeg ob = new FeeLeg(feeLegNode); IDManager.SetID(feeLegIDRef_, ob); } else if (feeLegNode.Attributes["href"] != null) { feeLegIDRef_ = feeLegNode.Attributes["href"].Value; } else { feeLeg_ = new FeeLeg(feeLegNode); } } else { feeLeg_ = new FeeLeg(feeLegNode); } } XmlNodeList protectionTermsNodeList = xmlNode.SelectNodes("protectionTerms"); if (protectionTermsNodeList != null) { this.protectionTerms_ = new List<ProtectionTerms>(); foreach (XmlNode item in protectionTermsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { protectionTermsIDRef_ = item.Attributes["id"].Value; protectionTerms_.Add(new ProtectionTerms(item)); IDManager.SetID(protectionTermsIDRef_, protectionTerms_[protectionTerms_.Count - 1 ]); } else if (item.Attributes["href"] != null) { protectionTermsIDRef_ = item.Attributes["href"].Value; } else { protectionTerms_.Add(new ProtectionTerms(item)); } } else { protectionTerms_.Add(new ProtectionTerms(item)); } } } XmlNode cashSettlementTermsNode = xmlNode.SelectSingleNode("cashSettlementTerms"); if (cashSettlementTermsNode != null) { if (cashSettlementTermsNode.Attributes["href"] != null || cashSettlementTermsNode.Attributes["id"] != null) { if (cashSettlementTermsNode.Attributes["id"] != null) { cashSettlementTermsIDRef_ = cashSettlementTermsNode.Attributes["id"].Value; CashSettlementTerms ob = new CashSettlementTerms(cashSettlementTermsNode); IDManager.SetID(cashSettlementTermsIDRef_, ob); } else if (cashSettlementTermsNode.Attributes["href"] != null) { cashSettlementTermsIDRef_ = cashSettlementTermsNode.Attributes["href"].Value; } else { cashSettlementTerms_ = new CashSettlementTerms(cashSettlementTermsNode); } } else { cashSettlementTerms_ = new CashSettlementTerms(cashSettlementTermsNode); } } XmlNode physicalSettlementTermsNode = xmlNode.SelectSingleNode("physicalSettlementTerms"); if (physicalSettlementTermsNode != null) { if (physicalSettlementTermsNode.Attributes["href"] != null || physicalSettlementTermsNode.Attributes["id"] != null) { if (physicalSettlementTermsNode.Attributes["id"] != null) { physicalSettlementTermsIDRef_ = physicalSettlementTermsNode.Attributes["id"].Value; PhysicalSettlementTerms ob = new PhysicalSettlementTerms(physicalSettlementTermsNode); IDManager.SetID(physicalSettlementTermsIDRef_, ob); } else if (physicalSettlementTermsNode.Attributes["href"] != null) { physicalSettlementTermsIDRef_ = physicalSettlementTermsNode.Attributes["href"].Value; } else { physicalSettlementTerms_ = new PhysicalSettlementTerms(physicalSettlementTermsNode); } } else { physicalSettlementTerms_ = new PhysicalSettlementTerms(physicalSettlementTermsNode); } } }