public DualCurrencyFeature(XmlNode xmlNode) { XmlNode currencyNode = xmlNode.SelectSingleNode("currency"); if (currencyNode != null) { if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) { if (currencyNode.Attributes["id"] != null) { currencyIDRef_ = currencyNode.Attributes["id"].Value; Currency ob = new Currency(currencyNode); IDManager.SetID(currencyIDRef_, ob); } else if (currencyNode.Attributes["href"] != null) { currencyIDRef_ = currencyNode.Attributes["href"].Value; } else { currency_ = new Currency(currencyNode); } } else { currency_ = new Currency(currencyNode); } } XmlNode fixingDateNode = xmlNode.SelectSingleNode("fixingDate"); if (fixingDateNode != null) { if (fixingDateNode.Attributes["href"] != null || fixingDateNode.Attributes["id"] != null) { if (fixingDateNode.Attributes["id"] != null) { fixingDateIDRef_ = fixingDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(fixingDateNode); IDManager.SetID(fixingDateIDRef_, ob); } else if (fixingDateNode.Attributes["href"] != null) { fixingDateIDRef_ = fixingDateNode.Attributes["href"].Value; } else { fixingDate_ = new XsdTypeDate(fixingDateNode); } } else { fixingDate_ = new XsdTypeDate(fixingDateNode); } } XmlNode fixingTimeNode = xmlNode.SelectSingleNode("fixingTime"); if (fixingTimeNode != null) { if (fixingTimeNode.Attributes["href"] != null || fixingTimeNode.Attributes["id"] != null) { if (fixingTimeNode.Attributes["id"] != null) { fixingTimeIDRef_ = fixingTimeNode.Attributes["id"].Value; BusinessCenterTime ob = new BusinessCenterTime(fixingTimeNode); IDManager.SetID(fixingTimeIDRef_, ob); } else if (fixingTimeNode.Attributes["href"] != null) { fixingTimeIDRef_ = fixingTimeNode.Attributes["href"].Value; } else { fixingTime_ = new BusinessCenterTime(fixingTimeNode); } } else { fixingTime_ = new BusinessCenterTime(fixingTimeNode); } } XmlNode strikeNode = xmlNode.SelectSingleNode("strike"); if (strikeNode != null) { if (strikeNode.Attributes["href"] != null || strikeNode.Attributes["id"] != null) { if (strikeNode.Attributes["id"] != null) { strikeIDRef_ = strikeNode.Attributes["id"].Value; DualCurrencyStrikePrice ob = new DualCurrencyStrikePrice(strikeNode); IDManager.SetID(strikeIDRef_, ob); } else if (strikeNode.Attributes["href"] != null) { strikeIDRef_ = strikeNode.Attributes["href"].Value; } else { strike_ = new DualCurrencyStrikePrice(strikeNode); } } else { strike_ = new DualCurrencyStrikePrice(strikeNode); } } XmlNode spotRateNode = xmlNode.SelectSingleNode("spotRate"); if (spotRateNode != null) { if (spotRateNode.Attributes["href"] != null || spotRateNode.Attributes["id"] != null) { if (spotRateNode.Attributes["id"] != null) { spotRateIDRef_ = spotRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(spotRateNode); IDManager.SetID(spotRateIDRef_, ob); } else if (spotRateNode.Attributes["href"] != null) { spotRateIDRef_ = spotRateNode.Attributes["href"].Value; } else { spotRate_ = new XsdTypeDecimal(spotRateNode); } } else { spotRate_ = new XsdTypeDecimal(spotRateNode); } } XmlNode interestAtRiskNode = xmlNode.SelectSingleNode("interestAtRisk"); if (interestAtRiskNode != null) { if (interestAtRiskNode.Attributes["href"] != null || interestAtRiskNode.Attributes["id"] != null) { if (interestAtRiskNode.Attributes["id"] != null) { interestAtRiskIDRef_ = interestAtRiskNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(interestAtRiskNode); IDManager.SetID(interestAtRiskIDRef_, ob); } else if (interestAtRiskNode.Attributes["href"] != null) { interestAtRiskIDRef_ = interestAtRiskNode.Attributes["href"].Value; } else { interestAtRisk_ = new XsdTypeBoolean(interestAtRiskNode); } } else { interestAtRisk_ = new XsdTypeBoolean(interestAtRiskNode); } } }
public DualCurrencyFeature(XmlNode xmlNode) { XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency"); if (currencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(currencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyIDRef = item.Attributes["href"].Name; } else { currency = new Currency(item); } } } XmlNodeList fixingDateNodeList = xmlNode.SelectNodes("fixingDate"); if (fixingDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in fixingDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fixingDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(fixingDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { fixingDateIDRef = item.Attributes["href"].Name; } else { fixingDate = new XsdTypeDate(item); } } } XmlNodeList fixingTimeNodeList = xmlNode.SelectNodes("fixingTime"); if (fixingTimeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in fixingTimeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fixingTimeIDRef = item.Attributes["id"].Name; BusinessCenterTime ob = BusinessCenterTime(); IDManager.SetID(fixingTimeIDRef, ob); } else if (item.Attributes.ToString() == "href") { fixingTimeIDRef = item.Attributes["href"].Name; } else { fixingTime = new BusinessCenterTime(item); } } } XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike"); if (strikeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in strikeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeIDRef = item.Attributes["id"].Name; DualCurrencyStrikePrice ob = DualCurrencyStrikePrice(); IDManager.SetID(strikeIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeIDRef = item.Attributes["href"].Name; } else { strike = new DualCurrencyStrikePrice(item); } } } XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate"); if (spotRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in spotRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spotRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(spotRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { spotRateIDRef = item.Attributes["href"].Name; } else { spotRate = new XsdTypeDecimal(item); } } } XmlNodeList interestAtRiskNodeList = xmlNode.SelectNodes("interestAtRisk"); if (interestAtRiskNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in interestAtRiskNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { interestAtRiskIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(interestAtRiskIDRef, ob); } else if (item.Attributes.ToString() == "href") { interestAtRiskIDRef = item.Attributes["href"].Name; } else { interestAtRisk = new XsdTypeBoolean(item); } } } }
public DualCurrencyFeature(XmlNode xmlNode) { XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency"); if (currencyNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in currencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyIDRef = item.Attributes["id"].Name; Currency ob = Currency(); IDManager.SetID(currencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyIDRef = item.Attributes["href"].Name; } else { currency = new Currency(item); } } } XmlNodeList fixingDateNodeList = xmlNode.SelectNodes("fixingDate"); if (fixingDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in fixingDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fixingDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(fixingDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { fixingDateIDRef = item.Attributes["href"].Name; } else { fixingDate = new XsdTypeDate(item); } } } XmlNodeList fixingTimeNodeList = xmlNode.SelectNodes("fixingTime"); if (fixingTimeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in fixingTimeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fixingTimeIDRef = item.Attributes["id"].Name; BusinessCenterTime ob = BusinessCenterTime(); IDManager.SetID(fixingTimeIDRef, ob); } else if (item.Attributes.ToString() == "href") { fixingTimeIDRef = item.Attributes["href"].Name; } else { fixingTime = new BusinessCenterTime(item); } } } XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike"); if (strikeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in strikeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { strikeIDRef = item.Attributes["id"].Name; DualCurrencyStrikePrice ob = DualCurrencyStrikePrice(); IDManager.SetID(strikeIDRef, ob); } else if (item.Attributes.ToString() == "href") { strikeIDRef = item.Attributes["href"].Name; } else { strike = new DualCurrencyStrikePrice(item); } } } XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate"); if (spotRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in spotRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spotRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(spotRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { spotRateIDRef = item.Attributes["href"].Name; } else { spotRate = new XsdTypeDecimal(item); } } } XmlNodeList interestAtRiskNodeList = xmlNode.SelectNodes("interestAtRisk"); if (interestAtRiskNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in interestAtRiskNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { interestAtRiskIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(interestAtRiskIDRef, ob); } else if (item.Attributes.ToString() == "href") { interestAtRiskIDRef = item.Attributes["href"].Name; } else { interestAtRisk = new XsdTypeBoolean(item); } } } }