public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList inputsNodeList = xmlNode.SelectNodes("inputs"); if (inputsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in inputsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { inputsIDRef = item.Attributes["id"].Name; QuotedAssetSet ob = QuotedAssetSet(); IDManager.SetID(inputsIDRef, ob); } else if (item.Attributes.ToString() == "href") { inputsIDRef = item.Attributes["href"].Name; } else { inputs = new QuotedAssetSet(item); } } } XmlNodeList zeroCurveNodeList = xmlNode.SelectNodes("zeroCurve"); if (zeroCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in zeroCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { zeroCurveIDRef = item.Attributes["id"].Name; ZeroRateCurve ob = ZeroRateCurve(); IDManager.SetID(zeroCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { zeroCurveIDRef = item.Attributes["href"].Name; } else { zeroCurve = new ZeroRateCurve(item); } } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forwardCurveIDRef = item.Attributes["id"].Name; List <ForwardRateCurve> ob = new List <ForwardRateCurve>(); ob.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { forwardCurveIDRef = item.Attributes["href"].Name; } else { forwardCurve.Add(new ForwardRateCurve(item)); } } } XmlNodeList discountFactorCurveNodeList = xmlNode.SelectNodes("discountFactorCurve"); if (discountFactorCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in discountFactorCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountFactorCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(discountFactorCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountFactorCurveIDRef = item.Attributes["href"].Name; } else { discountFactorCurve = new TermCurve(item); } } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList inputsNodeList = xmlNode.SelectNodes("inputs"); if (inputsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in inputsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { inputsIDRef = item.Attributes["id"].Name; QuotedAssetSet ob = QuotedAssetSet(); IDManager.SetID(inputsIDRef, ob); } else if (item.Attributes.ToString() == "href") { inputsIDRef = item.Attributes["href"].Name; } else { inputs = new QuotedAssetSet(item); } } } XmlNodeList zeroCurveNodeList = xmlNode.SelectNodes("zeroCurve"); if (zeroCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in zeroCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { zeroCurveIDRef = item.Attributes["id"].Name; ZeroRateCurve ob = ZeroRateCurve(); IDManager.SetID(zeroCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { zeroCurveIDRef = item.Attributes["href"].Name; } else { zeroCurve = new ZeroRateCurve(item); } } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forwardCurveIDRef = item.Attributes["id"].Name; List<ForwardRateCurve> ob = new List<ForwardRateCurve>(); ob.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { forwardCurveIDRef = item.Attributes["href"].Name; } else { forwardCurve.Add(new ForwardRateCurve(item)); } } } XmlNodeList discountFactorCurveNodeList = xmlNode.SelectNodes("discountFactorCurve"); if (discountFactorCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in discountFactorCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountFactorCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(discountFactorCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountFactorCurveIDRef = item.Attributes["href"].Name; } else { discountFactorCurve = new TermCurve(item); } } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNode inputsNode = xmlNode.SelectSingleNode("inputs"); if (inputsNode != null) { if (inputsNode.Attributes["href"] != null || inputsNode.Attributes["id"] != null) { if (inputsNode.Attributes["id"] != null) { inputsIDRef_ = inputsNode.Attributes["id"].Value; QuotedAssetSet ob = new QuotedAssetSet(inputsNode); IDManager.SetID(inputsIDRef_, ob); } else if (inputsNode.Attributes["href"] != null) { inputsIDRef_ = inputsNode.Attributes["href"].Value; } else { inputs_ = new QuotedAssetSet(inputsNode); } } else { inputs_ = new QuotedAssetSet(inputsNode); } } XmlNode zeroCurveNode = xmlNode.SelectSingleNode("zeroCurve"); if (zeroCurveNode != null) { if (zeroCurveNode.Attributes["href"] != null || zeroCurveNode.Attributes["id"] != null) { if (zeroCurveNode.Attributes["id"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["id"].Value; ZeroRateCurve ob = new ZeroRateCurve(zeroCurveNode); IDManager.SetID(zeroCurveIDRef_, ob); } else if (zeroCurveNode.Attributes["href"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["href"].Value; } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); if (forwardCurveNodeList != null) { this.forwardCurve_ = new List <ForwardRateCurve>(); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { forwardCurveIDRef_ = item.Attributes["id"].Value; forwardCurve_.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef_, forwardCurve_[forwardCurve_.Count - 1]); } else if (item.Attributes["href"] != null) { forwardCurveIDRef_ = item.Attributes["href"].Value; } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } } XmlNode discountFactorCurveNode = xmlNode.SelectSingleNode("discountFactorCurve"); if (discountFactorCurveNode != null) { if (discountFactorCurveNode.Attributes["href"] != null || discountFactorCurveNode.Attributes["id"] != null) { if (discountFactorCurveNode.Attributes["id"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(discountFactorCurveNode); IDManager.SetID(discountFactorCurveIDRef_, ob); } else if (discountFactorCurveNode.Attributes["href"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["href"].Value; } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNode inputsNode = xmlNode.SelectSingleNode("inputs"); if (inputsNode != null) { if (inputsNode.Attributes["href"] != null || inputsNode.Attributes["id"] != null) { if (inputsNode.Attributes["id"] != null) { inputsIDRef_ = inputsNode.Attributes["id"].Value; QuotedAssetSet ob = new QuotedAssetSet(inputsNode); IDManager.SetID(inputsIDRef_, ob); } else if (inputsNode.Attributes["href"] != null) { inputsIDRef_ = inputsNode.Attributes["href"].Value; } else { inputs_ = new QuotedAssetSet(inputsNode); } } else { inputs_ = new QuotedAssetSet(inputsNode); } } XmlNode zeroCurveNode = xmlNode.SelectSingleNode("zeroCurve"); if (zeroCurveNode != null) { if (zeroCurveNode.Attributes["href"] != null || zeroCurveNode.Attributes["id"] != null) { if (zeroCurveNode.Attributes["id"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["id"].Value; ZeroRateCurve ob = new ZeroRateCurve(zeroCurveNode); IDManager.SetID(zeroCurveIDRef_, ob); } else if (zeroCurveNode.Attributes["href"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["href"].Value; } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); if (forwardCurveNodeList != null) { this.forwardCurve_ = new List<ForwardRateCurve>(); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { forwardCurveIDRef_ = item.Attributes["id"].Value; forwardCurve_.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef_, forwardCurve_[forwardCurve_.Count - 1 ]); } else if (item.Attributes["href"] != null) { forwardCurveIDRef_ = item.Attributes["href"].Value; } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } } XmlNode discountFactorCurveNode = xmlNode.SelectSingleNode("discountFactorCurve"); if (discountFactorCurveNode != null) { if (discountFactorCurveNode.Attributes["href"] != null || discountFactorCurveNode.Attributes["id"] != null) { if (discountFactorCurveNode.Attributes["id"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(discountFactorCurveNode); IDManager.SetID(discountFactorCurveIDRef_, ob); } else if (discountFactorCurveNode.Attributes["href"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["href"].Value; } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } }