public DualCurrencyStrikePrice(XmlNode xmlNode) { XmlNode rateNode = xmlNode.SelectSingleNode("rate"); if (rateNode != null) { if (rateNode.Attributes["href"] != null || rateNode.Attributes["id"] != null) { if (rateNode.Attributes["id"] != null) { rateIDRef_ = rateNode.Attributes["id"].Value; PositiveDecimal ob = new PositiveDecimal(rateNode); IDManager.SetID(rateIDRef_, ob); } else if (rateNode.Attributes["href"] != null) { rateIDRef_ = rateNode.Attributes["href"].Value; } else { rate_ = new PositiveDecimal(rateNode); } } else { rate_ = new PositiveDecimal(rateNode); } } XmlNode strikeQuoteBasisNode = xmlNode.SelectSingleNode("strikeQuoteBasis"); if (strikeQuoteBasisNode != null) { if (strikeQuoteBasisNode.Attributes["href"] != null || strikeQuoteBasisNode.Attributes["id"] != null) { if (strikeQuoteBasisNode.Attributes["id"] != null) { strikeQuoteBasisIDRef_ = strikeQuoteBasisNode.Attributes["id"].Value; DualCurrencyStrikeQuoteBasisEnum ob = new DualCurrencyStrikeQuoteBasisEnum(strikeQuoteBasisNode); IDManager.SetID(strikeQuoteBasisIDRef_, ob); } else if (strikeQuoteBasisNode.Attributes["href"] != null) { strikeQuoteBasisIDRef_ = strikeQuoteBasisNode.Attributes["href"].Value; } else { strikeQuoteBasis_ = new DualCurrencyStrikeQuoteBasisEnum(strikeQuoteBasisNode); } } else { strikeQuoteBasis_ = new DualCurrencyStrikeQuoteBasisEnum(strikeQuoteBasisNode); } } }
public DualCurrencyStrikePrice(XmlNode xmlNode) { XmlNodeList rateNodeList = xmlNode.SelectNodes("rate"); if (rateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in rateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateIDRef = item.Attributes["id"].Name; PositiveDecimal ob = PositiveDecimal(); IDManager.SetID(rateIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateIDRef = item.Attributes["href"].Name; } else { rate = new PositiveDecimal(item); } } } XmlNodeList strikeQuoteBasisNodeList = xmlNode.SelectNodes("strikeQuoteBasis"); if (strikeQuoteBasisNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in strikeQuoteBasisNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeQuoteBasisIDRef = item.Attributes["id"].Name; DualCurrencyStrikeQuoteBasisEnum ob = DualCurrencyStrikeQuoteBasisEnum(); IDManager.SetID(strikeQuoteBasisIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeQuoteBasisIDRef = item.Attributes["href"].Name; } else { strikeQuoteBasis = new DualCurrencyStrikeQuoteBasisEnum(item); } } } }