public CreditOptionStrike(XmlNode xmlNode) { XmlNode spreadNode = xmlNode.SelectSingleNode("spread"); if (spreadNode != null) { if (spreadNode.Attributes["href"] != null || spreadNode.Attributes["id"] != null) { if (spreadNode.Attributes["id"] != null) { spreadIDRef_ = spreadNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(spreadNode); IDManager.SetID(spreadIDRef_, ob); } else if (spreadNode.Attributes["href"] != null) { spreadIDRef_ = spreadNode.Attributes["href"].Value; } else { spread_ = new XsdTypeDecimal(spreadNode); } } else { spread_ = new XsdTypeDecimal(spreadNode); } } XmlNode priceNode = xmlNode.SelectSingleNode("price"); if (priceNode != null) { if (priceNode.Attributes["href"] != null || priceNode.Attributes["id"] != null) { if (priceNode.Attributes["id"] != null) { priceIDRef_ = priceNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(priceNode); IDManager.SetID(priceIDRef_, ob); } else if (priceNode.Attributes["href"] != null) { priceIDRef_ = priceNode.Attributes["href"].Value; } else { price_ = new XsdTypeDecimal(priceNode); } } else { price_ = new XsdTypeDecimal(priceNode); } } XmlNode strikeReferenceNode = xmlNode.SelectSingleNode("strikeReference"); if (strikeReferenceNode != null) { if (strikeReferenceNode.Attributes["href"] != null || strikeReferenceNode.Attributes["id"] != null) { if (strikeReferenceNode.Attributes["id"] != null) { strikeReferenceIDRef_ = strikeReferenceNode.Attributes["id"].Value; FixedRateReference ob = new FixedRateReference(strikeReferenceNode); IDManager.SetID(strikeReferenceIDRef_, ob); } else if (strikeReferenceNode.Attributes["href"] != null) { strikeReferenceIDRef_ = strikeReferenceNode.Attributes["href"].Value; } else { strikeReference_ = new FixedRateReference(strikeReferenceNode); } } else { strikeReference_ = new FixedRateReference(strikeReferenceNode); } } }
public CreditOptionStrike(XmlNode xmlNode) { XmlNodeList spreadNodeList = xmlNode.SelectNodes("spread"); if (spreadNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in spreadNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spreadIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(spreadIDRef, ob); } else if (item.Attributes.ToString() == "href") { spreadIDRef = item.Attributes["href"].Name; } else { spread = new XsdTypeDecimal(item); } } } XmlNodeList priceNodeList = xmlNode.SelectNodes("price"); if (priceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in priceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { priceIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(priceIDRef, ob); } else if (item.Attributes.ToString() == "href") { priceIDRef = item.Attributes["href"].Name; } else { price = new XsdTypeDecimal(item); } } } XmlNodeList strikeReferenceNodeList = xmlNode.SelectNodes("strikeReference"); if (strikeReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strikeReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeReferenceIDRef = item.Attributes["id"].Name; FixedRateReference ob = FixedRateReference(); IDManager.SetID(strikeReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeReferenceIDRef = item.Attributes["href"].Name; } else { strikeReference = new FixedRateReference(item); } } } }
public CreditOptionStrike(XmlNode xmlNode) { XmlNodeList spreadNodeList = xmlNode.SelectNodes("spread"); if (spreadNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in spreadNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spreadIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(spreadIDRef, ob); } else if (item.Attributes.ToString() == "href") { spreadIDRef = item.Attributes["href"].Name; } else { spread = new XsdTypeDecimal(item); } } } XmlNodeList priceNodeList = xmlNode.SelectNodes("price"); if (priceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in priceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { priceIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(priceIDRef, ob); } else if (item.Attributes.ToString() == "href") { priceIDRef = item.Attributes["href"].Name; } else { price = new XsdTypeDecimal(item); } } } XmlNodeList strikeReferenceNodeList = xmlNode.SelectNodes("strikeReference"); if (strikeReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in strikeReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeReferenceIDRef = item.Attributes["id"].Name; FixedRateReference ob = FixedRateReference(); IDManager.SetID(strikeReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeReferenceIDRef = item.Attributes["href"].Name; } else { strikeReference = new FixedRateReference(item); } } } }