public VolatilityMatrix(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList dataPointsNodeList = xmlNode.SelectNodes("dataPoints");
     if (dataPointsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dataPointsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dataPointsIDRef = item.Attributes["id"].Name;
                 MultiDimensionalPricingData ob = MultiDimensionalPricingData();
                 IDManager.SetID(dataPointsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dataPointsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dataPoints = new MultiDimensionalPricingData(item);
             }
         }
     }
     
 
     XmlNodeList adjustmentNodeList = xmlNode.SelectNodes("adjustment");
     
     foreach (XmlNode item in adjustmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 adjustmentIDRef = item.Attributes["id"].Name;
                 List<ParametricAdjustment> ob = new List<ParametricAdjustment>();
                 ob.Add(new ParametricAdjustment(item));
                 IDManager.SetID(adjustmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 adjustmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
             adjustment.Add(new ParametricAdjustment(item));
             }
         }
     }
     
 
 }
Esempio n. 2
0
        public VolatilityMatrix(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList dataPointsNodeList = xmlNode.SelectNodes("dataPoints");

            if (dataPointsNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in dataPointsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dataPointsIDRef = item.Attributes["id"].Name;
                        MultiDimensionalPricingData ob = MultiDimensionalPricingData();
                        IDManager.SetID(dataPointsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dataPointsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dataPoints = new MultiDimensionalPricingData(item);
                    }
                }
            }


            XmlNodeList adjustmentNodeList = xmlNode.SelectNodes("adjustment");

            foreach (XmlNode item in adjustmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        adjustmentIDRef = item.Attributes["id"].Name;
                        List <ParametricAdjustment> ob = new List <ParametricAdjustment>();
                        ob.Add(new ParametricAdjustment(item));
                        IDManager.SetID(adjustmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        adjustmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        adjustment.Add(new ParametricAdjustment(item));
                    }
                }
            }
        }
 public VolatilityMatrix(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode dataPointsNode = xmlNode.SelectSingleNode("dataPoints");
     
     if (dataPointsNode != null)
     {
         if (dataPointsNode.Attributes["href"] != null || dataPointsNode.Attributes["id"] != null) 
         {
             if (dataPointsNode.Attributes["id"] != null) 
             {
                 dataPointsIDRef_ = dataPointsNode.Attributes["id"].Value;
                 MultiDimensionalPricingData ob = new MultiDimensionalPricingData(dataPointsNode);
                 IDManager.SetID(dataPointsIDRef_, ob);
             }
             else if (dataPointsNode.Attributes["href"] != null)
             {
                 dataPointsIDRef_ = dataPointsNode.Attributes["href"].Value;
             }
             else
             {
                 dataPoints_ = new MultiDimensionalPricingData(dataPointsNode);
             }
         }
         else
         {
             dataPoints_ = new MultiDimensionalPricingData(dataPointsNode);
         }
     }
     
 
     XmlNodeList adjustmentNodeList = xmlNode.SelectNodes("adjustment");
     
     if (adjustmentNodeList != null)
     {
         this.adjustment_ = new List<ParametricAdjustment>();
         foreach (XmlNode item in adjustmentNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     adjustmentIDRef_ = item.Attributes["id"].Value;
                     adjustment_.Add(new ParametricAdjustment(item));
                     IDManager.SetID(adjustmentIDRef_, adjustment_[adjustment_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     adjustmentIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 adjustment_.Add(new ParametricAdjustment(item));
                 }
             }
             else
             {
                 adjustment_.Add(new ParametricAdjustment(item));
             }
         }
     }
     
 
 }
        public VolatilityMatrix(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode dataPointsNode = xmlNode.SelectSingleNode("dataPoints");

            if (dataPointsNode != null)
            {
                if (dataPointsNode.Attributes["href"] != null || dataPointsNode.Attributes["id"] != null)
                {
                    if (dataPointsNode.Attributes["id"] != null)
                    {
                        dataPointsIDRef_ = dataPointsNode.Attributes["id"].Value;
                        MultiDimensionalPricingData ob = new MultiDimensionalPricingData(dataPointsNode);
                        IDManager.SetID(dataPointsIDRef_, ob);
                    }
                    else if (dataPointsNode.Attributes["href"] != null)
                    {
                        dataPointsIDRef_ = dataPointsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dataPoints_ = new MultiDimensionalPricingData(dataPointsNode);
                    }
                }
                else
                {
                    dataPoints_ = new MultiDimensionalPricingData(dataPointsNode);
                }
            }


            XmlNodeList adjustmentNodeList = xmlNode.SelectNodes("adjustment");

            if (adjustmentNodeList != null)
            {
                this.adjustment_ = new List <ParametricAdjustment>();
                foreach (XmlNode item in adjustmentNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            adjustmentIDRef_ = item.Attributes["id"].Value;
                            adjustment_.Add(new ParametricAdjustment(item));
                            IDManager.SetID(adjustmentIDRef_, adjustment_[adjustment_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            adjustmentIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            adjustment_.Add(new ParametricAdjustment(item));
                        }
                    }
                    else
                    {
                        adjustment_.Add(new ParametricAdjustment(item));
                    }
                }
            }
        }