Ejemplo n.º 1
0
        public PayoffBase(XmlNode xmlNode)
        {
            XmlNodeList payoffDateNodeList = xmlNode.SelectNodes("payoffDate");

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

            foreach (XmlNode item in payoffDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payoffDateIDRef = item.Attributes["id"].Name;
                        XsdTypeToken ob = XsdTypeToken();
                        IDManager.SetID(payoffDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payoffDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payoffDate = new XsdTypeToken(item);
                    }
                }
            }


            XmlNodeList constPayoffNodeList = xmlNode.SelectNodes("constPayoff");

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

            foreach (XmlNode item in constPayoffNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        constPayoffIDRef = item.Attributes["id"].Name;
                        ConstPayoff ob = ConstPayoff();
                        IDManager.SetID(constPayoffIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        constPayoffIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        constPayoff = new ConstPayoff(item);
                    }
                }
            }


            XmlNodeList nullPayoffNodeList = xmlNode.SelectNodes("nullPayoff");

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

            foreach (XmlNode item in nullPayoffNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        nullPayoffIDRef = item.Attributes["id"].Name;
                        NullPayoff ob = NullPayoff();
                        IDManager.SetID(nullPayoffIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        nullPayoffIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        nullPayoff = new NullPayoff(item);
                    }
                }
            }


            XmlNodeList averPayoffNodeList = xmlNode.SelectNodes("averPayoff");

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

            foreach (XmlNode item in averPayoffNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        averPayoffIDRef = item.Attributes["id"].Name;
                        AverPayoff ob = AverPayoff();
                        IDManager.SetID(averPayoffIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        averPayoffIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        averPayoff = new AverPayoff(item);
                    }
                }
            }


            XmlNodeList exprPayoffNodeList = xmlNode.SelectNodes("exprPayoff");

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

            foreach (XmlNode item in exprPayoffNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exprPayoffIDRef = item.Attributes["id"].Name;
                        ExprPayoff ob = ExprPayoff();
                        IDManager.SetID(exprPayoffIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exprPayoffIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exprPayoff = new ExprPayoff(item);
                    }
                }
            }


            XmlNodeList preFixPayoffNodeList = xmlNode.SelectNodes("preFixPayoff");

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

            foreach (XmlNode item in preFixPayoffNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        preFixPayoffIDRef = item.Attributes["id"].Name;
                        PreFixPayoff ob = PreFixPayoff();
                        IDManager.SetID(preFixPayoffIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        preFixPayoffIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        preFixPayoff = new PreFixPayoff(item);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public PayoffCalculation(XmlNode xmlNode)
        {
            XmlNode constPayoffNode = xmlNode.SelectSingleNode("constPayoff");

            if (constPayoffNode != null)
            {
                if (constPayoffNode.Attributes["href"] != null || constPayoffNode.Attributes["id"] != null)
                {
                    if (constPayoffNode.Attributes["id"] != null)
                    {
                        constPayoffIDRef_ = constPayoffNode.Attributes["id"].Value;
                        ConstPayoff ob = new ConstPayoff(constPayoffNode);
                        IDManager.SetID(constPayoffIDRef_, ob);
                    }
                    else if (constPayoffNode.Attributes["href"] != null)
                    {
                        constPayoffIDRef_ = constPayoffNode.Attributes["href"].Value;
                    }
                    else
                    {
                        constPayoff_ = new ConstPayoff(constPayoffNode);
                    }
                }
                else
                {
                    constPayoff_ = new ConstPayoff(constPayoffNode);
                }
            }


            XmlNode nullPayoffNode = xmlNode.SelectSingleNode("nullPayoff");

            if (nullPayoffNode != null)
            {
                if (nullPayoffNode.Attributes["href"] != null || nullPayoffNode.Attributes["id"] != null)
                {
                    if (nullPayoffNode.Attributes["id"] != null)
                    {
                        nullPayoffIDRef_ = nullPayoffNode.Attributes["id"].Value;
                        NullPayoff ob = new NullPayoff(nullPayoffNode);
                        IDManager.SetID(nullPayoffIDRef_, ob);
                    }
                    else if (nullPayoffNode.Attributes["href"] != null)
                    {
                        nullPayoffIDRef_ = nullPayoffNode.Attributes["href"].Value;
                    }
                    else
                    {
                        nullPayoff_ = new NullPayoff(nullPayoffNode);
                    }
                }
                else
                {
                    nullPayoff_ = new NullPayoff(nullPayoffNode);
                }
            }


            XmlNode averPayoffNode = xmlNode.SelectSingleNode("averPayoff");

            if (averPayoffNode != null)
            {
                if (averPayoffNode.Attributes["href"] != null || averPayoffNode.Attributes["id"] != null)
                {
                    if (averPayoffNode.Attributes["id"] != null)
                    {
                        averPayoffIDRef_ = averPayoffNode.Attributes["id"].Value;
                        AverPayoff ob = new AverPayoff(averPayoffNode);
                        IDManager.SetID(averPayoffIDRef_, ob);
                    }
                    else if (averPayoffNode.Attributes["href"] != null)
                    {
                        averPayoffIDRef_ = averPayoffNode.Attributes["href"].Value;
                    }
                    else
                    {
                        averPayoff_ = new AverPayoff(averPayoffNode);
                    }
                }
                else
                {
                    averPayoff_ = new AverPayoff(averPayoffNode);
                }
            }


            XmlNode exprPayoffNode = xmlNode.SelectSingleNode("exprPayoff");

            if (exprPayoffNode != null)
            {
                if (exprPayoffNode.Attributes["href"] != null || exprPayoffNode.Attributes["id"] != null)
                {
                    if (exprPayoffNode.Attributes["id"] != null)
                    {
                        exprPayoffIDRef_ = exprPayoffNode.Attributes["id"].Value;
                        ExprPayoff ob = new ExprPayoff(exprPayoffNode);
                        IDManager.SetID(exprPayoffIDRef_, ob);
                    }
                    else if (exprPayoffNode.Attributes["href"] != null)
                    {
                        exprPayoffIDRef_ = exprPayoffNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exprPayoff_ = new ExprPayoff(exprPayoffNode);
                    }
                }
                else
                {
                    exprPayoff_ = new ExprPayoff(exprPayoffNode);
                }
            }


            XmlNode preFixPayoffNode = xmlNode.SelectSingleNode("preFixPayoff");

            if (preFixPayoffNode != null)
            {
                if (preFixPayoffNode.Attributes["href"] != null || preFixPayoffNode.Attributes["id"] != null)
                {
                    if (preFixPayoffNode.Attributes["id"] != null)
                    {
                        preFixPayoffIDRef_ = preFixPayoffNode.Attributes["id"].Value;
                        PreFixPayoff ob = new PreFixPayoff(preFixPayoffNode);
                        IDManager.SetID(preFixPayoffIDRef_, ob);
                    }
                    else if (preFixPayoffNode.Attributes["href"] != null)
                    {
                        preFixPayoffIDRef_ = preFixPayoffNode.Attributes["href"].Value;
                    }
                    else
                    {
                        preFixPayoff_ = new PreFixPayoff(preFixPayoffNode);
                    }
                }
                else
                {
                    preFixPayoff_ = new PreFixPayoff(preFixPayoffNode);
                }
            }
        }
 public PayoffCalculation(XmlNode xmlNode)
 {
     XmlNode constPayoffNode = xmlNode.SelectSingleNode("constPayoff");
     
     if (constPayoffNode != null)
     {
         if (constPayoffNode.Attributes["href"] != null || constPayoffNode.Attributes["id"] != null) 
         {
             if (constPayoffNode.Attributes["id"] != null) 
             {
                 constPayoffIDRef_ = constPayoffNode.Attributes["id"].Value;
                 ConstPayoff ob = new ConstPayoff(constPayoffNode);
                 IDManager.SetID(constPayoffIDRef_, ob);
             }
             else if (constPayoffNode.Attributes["href"] != null)
             {
                 constPayoffIDRef_ = constPayoffNode.Attributes["href"].Value;
             }
             else
             {
                 constPayoff_ = new ConstPayoff(constPayoffNode);
             }
         }
         else
         {
             constPayoff_ = new ConstPayoff(constPayoffNode);
         }
     }
     
 
     XmlNode nullPayoffNode = xmlNode.SelectSingleNode("nullPayoff");
     
     if (nullPayoffNode != null)
     {
         if (nullPayoffNode.Attributes["href"] != null || nullPayoffNode.Attributes["id"] != null) 
         {
             if (nullPayoffNode.Attributes["id"] != null) 
             {
                 nullPayoffIDRef_ = nullPayoffNode.Attributes["id"].Value;
                 NullPayoff ob = new NullPayoff(nullPayoffNode);
                 IDManager.SetID(nullPayoffIDRef_, ob);
             }
             else if (nullPayoffNode.Attributes["href"] != null)
             {
                 nullPayoffIDRef_ = nullPayoffNode.Attributes["href"].Value;
             }
             else
             {
                 nullPayoff_ = new NullPayoff(nullPayoffNode);
             }
         }
         else
         {
             nullPayoff_ = new NullPayoff(nullPayoffNode);
         }
     }
     
 
     XmlNode averPayoffNode = xmlNode.SelectSingleNode("averPayoff");
     
     if (averPayoffNode != null)
     {
         if (averPayoffNode.Attributes["href"] != null || averPayoffNode.Attributes["id"] != null) 
         {
             if (averPayoffNode.Attributes["id"] != null) 
             {
                 averPayoffIDRef_ = averPayoffNode.Attributes["id"].Value;
                 AverPayoff ob = new AverPayoff(averPayoffNode);
                 IDManager.SetID(averPayoffIDRef_, ob);
             }
             else if (averPayoffNode.Attributes["href"] != null)
             {
                 averPayoffIDRef_ = averPayoffNode.Attributes["href"].Value;
             }
             else
             {
                 averPayoff_ = new AverPayoff(averPayoffNode);
             }
         }
         else
         {
             averPayoff_ = new AverPayoff(averPayoffNode);
         }
     }
     
 
     XmlNode exprPayoffNode = xmlNode.SelectSingleNode("exprPayoff");
     
     if (exprPayoffNode != null)
     {
         if (exprPayoffNode.Attributes["href"] != null || exprPayoffNode.Attributes["id"] != null) 
         {
             if (exprPayoffNode.Attributes["id"] != null) 
             {
                 exprPayoffIDRef_ = exprPayoffNode.Attributes["id"].Value;
                 ExprPayoff ob = new ExprPayoff(exprPayoffNode);
                 IDManager.SetID(exprPayoffIDRef_, ob);
             }
             else if (exprPayoffNode.Attributes["href"] != null)
             {
                 exprPayoffIDRef_ = exprPayoffNode.Attributes["href"].Value;
             }
             else
             {
                 exprPayoff_ = new ExprPayoff(exprPayoffNode);
             }
         }
         else
         {
             exprPayoff_ = new ExprPayoff(exprPayoffNode);
         }
     }
     
 
     XmlNode preFixPayoffNode = xmlNode.SelectSingleNode("preFixPayoff");
     
     if (preFixPayoffNode != null)
     {
         if (preFixPayoffNode.Attributes["href"] != null || preFixPayoffNode.Attributes["id"] != null) 
         {
             if (preFixPayoffNode.Attributes["id"] != null) 
             {
                 preFixPayoffIDRef_ = preFixPayoffNode.Attributes["id"].Value;
                 PreFixPayoff ob = new PreFixPayoff(preFixPayoffNode);
                 IDManager.SetID(preFixPayoffIDRef_, ob);
             }
             else if (preFixPayoffNode.Attributes["href"] != null)
             {
                 preFixPayoffIDRef_ = preFixPayoffNode.Attributes["href"].Value;
             }
             else
             {
                 preFixPayoff_ = new PreFixPayoff(preFixPayoffNode);
             }
         }
         else
         {
             preFixPayoff_ = new PreFixPayoff(preFixPayoffNode);
         }
     }
     
 
 }
 public PayoffBase(XmlNode xmlNode)
 {
     XmlNodeList payoffDateNodeList = xmlNode.SelectNodes("payoffDate");
     if (payoffDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payoffDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payoffDateIDRef = item.Attributes["id"].Name;
                 XsdTypeToken ob = XsdTypeToken();
                 IDManager.SetID(payoffDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payoffDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payoffDate = new XsdTypeToken(item);
             }
         }
     }
     
 
     XmlNodeList constPayoffNodeList = xmlNode.SelectNodes("constPayoff");
     if (constPayoffNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in constPayoffNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 constPayoffIDRef = item.Attributes["id"].Name;
                 ConstPayoff ob = ConstPayoff();
                 IDManager.SetID(constPayoffIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 constPayoffIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 constPayoff = new ConstPayoff(item);
             }
         }
     }
     
 
     XmlNodeList nullPayoffNodeList = xmlNode.SelectNodes("nullPayoff");
     if (nullPayoffNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in nullPayoffNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 nullPayoffIDRef = item.Attributes["id"].Name;
                 NullPayoff ob = NullPayoff();
                 IDManager.SetID(nullPayoffIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 nullPayoffIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 nullPayoff = new NullPayoff(item);
             }
         }
     }
     
 
     XmlNodeList averPayoffNodeList = xmlNode.SelectNodes("averPayoff");
     if (averPayoffNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in averPayoffNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 averPayoffIDRef = item.Attributes["id"].Name;
                 AverPayoff ob = AverPayoff();
                 IDManager.SetID(averPayoffIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 averPayoffIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 averPayoff = new AverPayoff(item);
             }
         }
     }
     
 
     XmlNodeList exprPayoffNodeList = xmlNode.SelectNodes("exprPayoff");
     if (exprPayoffNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exprPayoffNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exprPayoffIDRef = item.Attributes["id"].Name;
                 ExprPayoff ob = ExprPayoff();
                 IDManager.SetID(exprPayoffIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exprPayoffIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exprPayoff = new ExprPayoff(item);
             }
         }
     }
     
 
     XmlNodeList preFixPayoffNodeList = xmlNode.SelectNodes("preFixPayoff");
     if (preFixPayoffNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in preFixPayoffNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 preFixPayoffIDRef = item.Attributes["id"].Name;
                 PreFixPayoff ob = PreFixPayoff();
                 IDManager.SetID(preFixPayoffIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 preFixPayoffIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 preFixPayoff = new PreFixPayoff(item);
             }
         }
     }
     
 
 }