public SensitivityDefinition(XmlNode xmlNode)
 {
     XmlNode nameNode = xmlNode.SelectSingleNode("name");
     
     if (nameNode != null)
     {
         if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) 
         {
             if (nameNode.Attributes["id"] != null) 
             {
                 nameIDRef_ = nameNode.Attributes["id"].Value;
                 XsdTypeString ob = new XsdTypeString(nameNode);
                 IDManager.SetID(nameIDRef_, ob);
             }
             else if (nameNode.Attributes["href"] != null)
             {
                 nameIDRef_ = nameNode.Attributes["href"].Value;
             }
             else
             {
                 name_ = new XsdTypeString(nameNode);
             }
         }
         else
         {
             name_ = new XsdTypeString(nameNode);
         }
     }
     
 
     XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference");
     
     if (valuationScenarioReferenceNode != null)
     {
         if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) 
         {
             if (valuationScenarioReferenceNode.Attributes["id"] != null) 
             {
                 valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value;
                 ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode);
                 IDManager.SetID(valuationScenarioReferenceIDRef_, ob);
             }
             else if (valuationScenarioReferenceNode.Attributes["href"] != null)
             {
                 valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode);
             }
         }
         else
         {
             valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode);
         }
     }
     
 
     XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative");
     
     if (partialDerivativeNodeList != null)
     {
         this.partialDerivative_ = new List<PricingParameterDerivative>();
         foreach (XmlNode item in partialDerivativeNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     partialDerivativeIDRef_ = item.Attributes["id"].Value;
                     partialDerivative_.Add(new PricingParameterDerivative(item));
                     IDManager.SetID(partialDerivativeIDRef_, partialDerivative_[partialDerivative_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     partialDerivativeIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 partialDerivative_.Add(new PricingParameterDerivative(item));
                 }
             }
             else
             {
                 partialDerivative_.Add(new PricingParameterDerivative(item));
             }
         }
     }
     
 
     XmlNode formulaNode = xmlNode.SelectSingleNode("formula");
     
     if (formulaNode != null)
     {
         if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null) 
         {
             if (formulaNode.Attributes["id"] != null) 
             {
                 formulaIDRef_ = formulaNode.Attributes["id"].Value;
                 DerivativeFormula ob = new DerivativeFormula(formulaNode);
                 IDManager.SetID(formulaIDRef_, ob);
             }
             else if (formulaNode.Attributes["href"] != null)
             {
                 formulaIDRef_ = formulaNode.Attributes["href"].Value;
             }
             else
             {
                 formula_ = new DerivativeFormula(formulaNode);
             }
         }
         else
         {
             formula_ = new DerivativeFormula(formulaNode);
         }
     }
     
 
     XmlNode termNode = xmlNode.SelectSingleNode("term");
     
     if (termNode != null)
     {
         if (termNode.Attributes["href"] != null || termNode.Attributes["id"] != null) 
         {
             if (termNode.Attributes["id"] != null) 
             {
                 termIDRef_ = termNode.Attributes["id"].Value;
                 TimeDimension ob = new TimeDimension(termNode);
                 IDManager.SetID(termIDRef_, ob);
             }
             else if (termNode.Attributes["href"] != null)
             {
                 termIDRef_ = termNode.Attributes["href"].Value;
             }
             else
             {
                 term_ = new TimeDimension(termNode);
             }
         }
         else
         {
             term_ = new TimeDimension(termNode);
         }
     }
     
 
     XmlNode coordinateNode = xmlNode.SelectSingleNode("coordinate");
     
     if (coordinateNode != null)
     {
         if (coordinateNode.Attributes["href"] != null || coordinateNode.Attributes["id"] != null) 
         {
             if (coordinateNode.Attributes["id"] != null) 
             {
                 coordinateIDRef_ = coordinateNode.Attributes["id"].Value;
                 PricingDataPointCoordinate ob = new PricingDataPointCoordinate(coordinateNode);
                 IDManager.SetID(coordinateIDRef_, ob);
             }
             else if (coordinateNode.Attributes["href"] != null)
             {
                 coordinateIDRef_ = coordinateNode.Attributes["href"].Value;
             }
             else
             {
                 coordinate_ = new PricingDataPointCoordinate(coordinateNode);
             }
         }
         else
         {
             coordinate_ = new PricingDataPointCoordinate(coordinateNode);
         }
     }
     
 
     XmlNode coordinateReferenceNode = xmlNode.SelectSingleNode("coordinateReference");
     
     if (coordinateReferenceNode != null)
     {
         if (coordinateReferenceNode.Attributes["href"] != null || coordinateReferenceNode.Attributes["id"] != null) 
         {
             if (coordinateReferenceNode.Attributes["id"] != null) 
             {
                 coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["id"].Value;
                 PricingDataPointCoordinateReference ob = new PricingDataPointCoordinateReference(coordinateReferenceNode);
                 IDManager.SetID(coordinateReferenceIDRef_, ob);
             }
             else if (coordinateReferenceNode.Attributes["href"] != null)
             {
                 coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode);
             }
         }
         else
         {
             coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode);
         }
     }
     
 
 }
Example #2
0
        public SensitivityDefinition(XmlNode xmlNode)
        {
            XmlNodeList nameNodeList = xmlNode.SelectNodes("name");

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

            foreach (XmlNode item in nameNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        nameIDRef = item.Attributes["id"].Name;
                        XsdTypeString ob = XsdTypeString();
                        IDManager.SetID(nameIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        nameIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        name = new XsdTypeString(item);
                    }
                }
            }


            XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference");

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

            foreach (XmlNode item in valuationScenarioReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        valuationScenarioReferenceIDRef = item.Attributes["id"].Name;
                        ValuationScenarioReference ob = ValuationScenarioReference();
                        IDManager.SetID(valuationScenarioReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        valuationScenarioReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        valuationScenarioReference = new ValuationScenarioReference(item);
                    }
                }
            }


            XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative");

            foreach (XmlNode item in partialDerivativeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        partialDerivativeIDRef = item.Attributes["id"].Name;
                        List <PricingParameterDerivative> ob = new List <PricingParameterDerivative>();
                        ob.Add(new PricingParameterDerivative(item));
                        IDManager.SetID(partialDerivativeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        partialDerivativeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        partialDerivative.Add(new PricingParameterDerivative(item));
                    }
                }
            }


            XmlNodeList formulaNodeList = xmlNode.SelectNodes("formula");

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

            foreach (XmlNode item in formulaNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        formulaIDRef = item.Attributes["id"].Name;
                        DerivativeFormula ob = DerivativeFormula();
                        IDManager.SetID(formulaIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        formulaIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        formula = new DerivativeFormula(item);
                    }
                }
            }


            XmlNodeList termNodeList = xmlNode.SelectNodes("term");

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

            foreach (XmlNode item in termNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        termIDRef = item.Attributes["id"].Name;
                        TimeDimension ob = TimeDimension();
                        IDManager.SetID(termIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        termIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        term = new TimeDimension(item);
                    }
                }
            }


            XmlNodeList coordinateNodeList = xmlNode.SelectNodes("coordinate");

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

            foreach (XmlNode item in coordinateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        coordinateIDRef = item.Attributes["id"].Name;
                        PricingDataPointCoordinate ob = PricingDataPointCoordinate();
                        IDManager.SetID(coordinateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        coordinateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        coordinate = new PricingDataPointCoordinate(item);
                    }
                }
            }


            XmlNodeList coordinateReferenceNodeList = xmlNode.SelectNodes("coordinateReference");

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

            foreach (XmlNode item in coordinateReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        coordinateReferenceIDRef = item.Attributes["id"].Name;
                        PricingDataPointCoordinateReference ob = PricingDataPointCoordinateReference();
                        IDManager.SetID(coordinateReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        coordinateReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        coordinateReference = new PricingDataPointCoordinateReference(item);
                    }
                }
            }
        }
Example #3
0
        public SensitivityDefinition(XmlNode xmlNode)
        {
            XmlNode nameNode = xmlNode.SelectSingleNode("name");

            if (nameNode != null)
            {
                if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null)
                {
                    if (nameNode.Attributes["id"] != null)
                    {
                        nameIDRef_ = nameNode.Attributes["id"].Value;
                        XsdTypeString ob = new XsdTypeString(nameNode);
                        IDManager.SetID(nameIDRef_, ob);
                    }
                    else if (nameNode.Attributes["href"] != null)
                    {
                        nameIDRef_ = nameNode.Attributes["href"].Value;
                    }
                    else
                    {
                        name_ = new XsdTypeString(nameNode);
                    }
                }
                else
                {
                    name_ = new XsdTypeString(nameNode);
                }
            }


            XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference");

            if (valuationScenarioReferenceNode != null)
            {
                if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null)
                {
                    if (valuationScenarioReferenceNode.Attributes["id"] != null)
                    {
                        valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value;
                        ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode);
                        IDManager.SetID(valuationScenarioReferenceIDRef_, ob);
                    }
                    else if (valuationScenarioReferenceNode.Attributes["href"] != null)
                    {
                        valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode);
                    }
                }
                else
                {
                    valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode);
                }
            }


            XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative");

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


            XmlNode formulaNode = xmlNode.SelectSingleNode("formula");

            if (formulaNode != null)
            {
                if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null)
                {
                    if (formulaNode.Attributes["id"] != null)
                    {
                        formulaIDRef_ = formulaNode.Attributes["id"].Value;
                        DerivativeFormula ob = new DerivativeFormula(formulaNode);
                        IDManager.SetID(formulaIDRef_, ob);
                    }
                    else if (formulaNode.Attributes["href"] != null)
                    {
                        formulaIDRef_ = formulaNode.Attributes["href"].Value;
                    }
                    else
                    {
                        formula_ = new DerivativeFormula(formulaNode);
                    }
                }
                else
                {
                    formula_ = new DerivativeFormula(formulaNode);
                }
            }


            XmlNode termNode = xmlNode.SelectSingleNode("term");

            if (termNode != null)
            {
                if (termNode.Attributes["href"] != null || termNode.Attributes["id"] != null)
                {
                    if (termNode.Attributes["id"] != null)
                    {
                        termIDRef_ = termNode.Attributes["id"].Value;
                        TimeDimension ob = new TimeDimension(termNode);
                        IDManager.SetID(termIDRef_, ob);
                    }
                    else if (termNode.Attributes["href"] != null)
                    {
                        termIDRef_ = termNode.Attributes["href"].Value;
                    }
                    else
                    {
                        term_ = new TimeDimension(termNode);
                    }
                }
                else
                {
                    term_ = new TimeDimension(termNode);
                }
            }


            XmlNode coordinateNode = xmlNode.SelectSingleNode("coordinate");

            if (coordinateNode != null)
            {
                if (coordinateNode.Attributes["href"] != null || coordinateNode.Attributes["id"] != null)
                {
                    if (coordinateNode.Attributes["id"] != null)
                    {
                        coordinateIDRef_ = coordinateNode.Attributes["id"].Value;
                        PricingDataPointCoordinate ob = new PricingDataPointCoordinate(coordinateNode);
                        IDManager.SetID(coordinateIDRef_, ob);
                    }
                    else if (coordinateNode.Attributes["href"] != null)
                    {
                        coordinateIDRef_ = coordinateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        coordinate_ = new PricingDataPointCoordinate(coordinateNode);
                    }
                }
                else
                {
                    coordinate_ = new PricingDataPointCoordinate(coordinateNode);
                }
            }


            XmlNode coordinateReferenceNode = xmlNode.SelectSingleNode("coordinateReference");

            if (coordinateReferenceNode != null)
            {
                if (coordinateReferenceNode.Attributes["href"] != null || coordinateReferenceNode.Attributes["id"] != null)
                {
                    if (coordinateReferenceNode.Attributes["id"] != null)
                    {
                        coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["id"].Value;
                        PricingDataPointCoordinateReference ob = new PricingDataPointCoordinateReference(coordinateReferenceNode);
                        IDManager.SetID(coordinateReferenceIDRef_, ob);
                    }
                    else if (coordinateReferenceNode.Attributes["href"] != null)
                    {
                        coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode);
                    }
                }
                else
                {
                    coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode);
                }
            }
        }
 public SensitivityDefinition(XmlNode xmlNode)
 {
     XmlNodeList nameNodeList = xmlNode.SelectNodes("name");
     if (nameNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in nameNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 nameIDRef = item.Attributes["id"].Name;
                 XsdTypeString ob = XsdTypeString();
                 IDManager.SetID(nameIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 nameIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 name = new XsdTypeString(item);
             }
         }
     }
     
 
     XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference");
     if (valuationScenarioReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in valuationScenarioReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 valuationScenarioReferenceIDRef = item.Attributes["id"].Name;
                 ValuationScenarioReference ob = ValuationScenarioReference();
                 IDManager.SetID(valuationScenarioReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 valuationScenarioReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 valuationScenarioReference = new ValuationScenarioReference(item);
             }
         }
     }
     
 
     XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative");
     
     foreach (XmlNode item in partialDerivativeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partialDerivativeIDRef = item.Attributes["id"].Name;
                 List<PricingParameterDerivative> ob = new List<PricingParameterDerivative>();
                 ob.Add(new PricingParameterDerivative(item));
                 IDManager.SetID(partialDerivativeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partialDerivativeIDRef = item.Attributes["href"].Name;
             }
             else
             {
             partialDerivative.Add(new PricingParameterDerivative(item));
             }
         }
     }
     
 
     XmlNodeList formulaNodeList = xmlNode.SelectNodes("formula");
     if (formulaNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in formulaNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 formulaIDRef = item.Attributes["id"].Name;
                 DerivativeFormula ob = DerivativeFormula();
                 IDManager.SetID(formulaIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 formulaIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 formula = new DerivativeFormula(item);
             }
         }
     }
     
 
     XmlNodeList termNodeList = xmlNode.SelectNodes("term");
     if (termNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in termNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 termIDRef = item.Attributes["id"].Name;
                 TimeDimension ob = TimeDimension();
                 IDManager.SetID(termIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 termIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 term = new TimeDimension(item);
             }
         }
     }
     
 
     XmlNodeList coordinateNodeList = xmlNode.SelectNodes("coordinate");
     if (coordinateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in coordinateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 coordinateIDRef = item.Attributes["id"].Name;
                 PricingDataPointCoordinate ob = PricingDataPointCoordinate();
                 IDManager.SetID(coordinateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 coordinateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 coordinate = new PricingDataPointCoordinate(item);
             }
         }
     }
     
 
     XmlNodeList coordinateReferenceNodeList = xmlNode.SelectNodes("coordinateReference");
     if (coordinateReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in coordinateReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 coordinateReferenceIDRef = item.Attributes["id"].Name;
                 PricingDataPointCoordinateReference ob = PricingDataPointCoordinateReference();
                 IDManager.SetID(coordinateReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 coordinateReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 coordinateReference = new PricingDataPointCoordinateReference(item);
             }
         }
     }
     
 
 }