Esempio n. 1
0
        public ValuationScenario(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 valuationDateNodeList = xmlNode.SelectNodes("valuationDate");

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

            foreach (XmlNode item in valuationDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        valuationDateIDRef = item.Attributes["id"].Name;
                        IdentifiedDate ob = IdentifiedDate();
                        IDManager.SetID(valuationDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        valuationDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        valuationDate = new IdentifiedDate(item);
                    }
                }
            }


            XmlNodeList marketReferenceNodeList = xmlNode.SelectNodes("marketReference");

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

            foreach (XmlNode item in marketReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        marketReferenceIDRef = item.Attributes["id"].Name;
                        MarketReference ob = MarketReference();
                        IDManager.SetID(marketReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        marketReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        marketReference = new MarketReference(item);
                    }
                }
            }


            XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift");

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


            XmlNodeList replacementNodeList = xmlNode.SelectNodes("replacement");

            foreach (XmlNode item in replacementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        replacementIDRef = item.Attributes["id"].Name;
                        List <PricingInputReplacement> ob = new List <PricingInputReplacement>();
                        ob.Add(new PricingInputReplacement(item));
                        IDManager.SetID(replacementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        replacementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        replacement.Add(new PricingInputReplacement(item));
                    }
                }
            }
        }
 public ValuationScenario(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 valuationDateNode = xmlNode.SelectSingleNode("valuationDate");
     
     if (valuationDateNode != null)
     {
         if (valuationDateNode.Attributes["href"] != null || valuationDateNode.Attributes["id"] != null) 
         {
             if (valuationDateNode.Attributes["id"] != null) 
             {
                 valuationDateIDRef_ = valuationDateNode.Attributes["id"].Value;
                 IdentifiedDate ob = new IdentifiedDate(valuationDateNode);
                 IDManager.SetID(valuationDateIDRef_, ob);
             }
             else if (valuationDateNode.Attributes["href"] != null)
             {
                 valuationDateIDRef_ = valuationDateNode.Attributes["href"].Value;
             }
             else
             {
                 valuationDate_ = new IdentifiedDate(valuationDateNode);
             }
         }
         else
         {
             valuationDate_ = new IdentifiedDate(valuationDateNode);
         }
     }
     
 
     XmlNode marketReferenceNode = xmlNode.SelectSingleNode("marketReference");
     
     if (marketReferenceNode != null)
     {
         if (marketReferenceNode.Attributes["href"] != null || marketReferenceNode.Attributes["id"] != null) 
         {
             if (marketReferenceNode.Attributes["id"] != null) 
             {
                 marketReferenceIDRef_ = marketReferenceNode.Attributes["id"].Value;
                 MarketReference ob = new MarketReference(marketReferenceNode);
                 IDManager.SetID(marketReferenceIDRef_, ob);
             }
             else if (marketReferenceNode.Attributes["href"] != null)
             {
                 marketReferenceIDRef_ = marketReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 marketReference_ = new MarketReference(marketReferenceNode);
             }
         }
         else
         {
             marketReference_ = new MarketReference(marketReferenceNode);
         }
     }
     
 
     XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift");
     
     if (shiftNodeList != null)
     {
         this.shift_ = new List<PricingParameterShift>();
         foreach (XmlNode item in shiftNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     shiftIDRef_ = item.Attributes["id"].Value;
                     shift_.Add(new PricingParameterShift(item));
                     IDManager.SetID(shiftIDRef_, shift_[shift_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     shiftIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 shift_.Add(new PricingParameterShift(item));
                 }
             }
             else
             {
                 shift_.Add(new PricingParameterShift(item));
             }
         }
     }
     
 
     XmlNodeList replacementNodeList = xmlNode.SelectNodes("replacement");
     
     if (replacementNodeList != null)
     {
         this.replacement_ = new List<PricingInputReplacement>();
         foreach (XmlNode item in replacementNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     replacementIDRef_ = item.Attributes["id"].Value;
                     replacement_.Add(new PricingInputReplacement(item));
                     IDManager.SetID(replacementIDRef_, replacement_[replacement_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     replacementIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 replacement_.Add(new PricingInputReplacement(item));
                 }
             }
             else
             {
                 replacement_.Add(new PricingInputReplacement(item));
             }
         }
     }
     
 
 }
Esempio n. 3
0
        public DerivedValuationScenario(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 baseValuationScenarioNode = xmlNode.SelectSingleNode("baseValuationScenario");

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


            XmlNode valuationDateNode = xmlNode.SelectSingleNode("valuationDate");

            if (valuationDateNode != null)
            {
                if (valuationDateNode.Attributes["href"] != null || valuationDateNode.Attributes["id"] != null)
                {
                    if (valuationDateNode.Attributes["id"] != null)
                    {
                        valuationDateIDRef_ = valuationDateNode.Attributes["id"].Value;
                        IdentifiedDate ob = new IdentifiedDate(valuationDateNode);
                        IDManager.SetID(valuationDateIDRef_, ob);
                    }
                    else if (valuationDateNode.Attributes["href"] != null)
                    {
                        valuationDateIDRef_ = valuationDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        valuationDate_ = new IdentifiedDate(valuationDateNode);
                    }
                }
                else
                {
                    valuationDate_ = new IdentifiedDate(valuationDateNode);
                }
            }


            XmlNode marketReferenceNode = xmlNode.SelectSingleNode("marketReference");

            if (marketReferenceNode != null)
            {
                if (marketReferenceNode.Attributes["href"] != null || marketReferenceNode.Attributes["id"] != null)
                {
                    if (marketReferenceNode.Attributes["id"] != null)
                    {
                        marketReferenceIDRef_ = marketReferenceNode.Attributes["id"].Value;
                        MarketReference ob = new MarketReference(marketReferenceNode);
                        IDManager.SetID(marketReferenceIDRef_, ob);
                    }
                    else if (marketReferenceNode.Attributes["href"] != null)
                    {
                        marketReferenceIDRef_ = marketReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        marketReference_ = new MarketReference(marketReferenceNode);
                    }
                }
                else
                {
                    marketReference_ = new MarketReference(marketReferenceNode);
                }
            }


            XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift");

            if (shiftNodeList != null)
            {
                this.shift_ = new List <PricingParameterShift>();
                foreach (XmlNode item in shiftNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            shiftIDRef_ = item.Attributes["id"].Value;
                            shift_.Add(new PricingParameterShift(item));
                            IDManager.SetID(shiftIDRef_, shift_[shift_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            shiftIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            shift_.Add(new PricingParameterShift(item));
                        }
                    }
                    else
                    {
                        shift_.Add(new PricingParameterShift(item));
                    }
                }
            }
        }
 public DerivedValuationScenario(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 baseValuationScenarioNodeList = xmlNode.SelectNodes("baseValuationScenario");
     if (baseValuationScenarioNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in baseValuationScenarioNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 baseValuationScenarioIDRef = item.Attributes["id"].Name;
                 ValuationScenarioReference ob = ValuationScenarioReference();
                 IDManager.SetID(baseValuationScenarioIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 baseValuationScenarioIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 baseValuationScenario = new ValuationScenarioReference(item);
             }
         }
     }
     
 
     XmlNodeList valuationDateNodeList = xmlNode.SelectNodes("valuationDate");
     if (valuationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in valuationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 valuationDateIDRef = item.Attributes["id"].Name;
                 IdentifiedDate ob = IdentifiedDate();
                 IDManager.SetID(valuationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 valuationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 valuationDate = new IdentifiedDate(item);
             }
         }
     }
     
 
     XmlNodeList marketReferenceNodeList = xmlNode.SelectNodes("marketReference");
     if (marketReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in marketReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 marketReferenceIDRef = item.Attributes["id"].Name;
                 MarketReference ob = MarketReference();
                 IDManager.SetID(marketReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 marketReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 marketReference = new MarketReference(item);
             }
         }
     }
     
 
     XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift");
     
     foreach (XmlNode item in shiftNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 shiftIDRef = item.Attributes["id"].Name;
                 List<PricingParameterShift> ob = new List<PricingParameterShift>();
                 ob.Add(new PricingParameterShift(item));
                 IDManager.SetID(shiftIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 shiftIDRef = item.Attributes["href"].Name;
             }
             else
             {
             shift.Add(new PricingParameterShift(item));
             }
         }
     }
     
 
 }