public StandardOption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode unitNode = xmlNode.SelectSingleNode("unit");
     
     if (unitNode != null)
     {
         if (unitNode.Attributes["href"] != null || unitNode.Attributes["id"] != null) 
         {
             if (unitNode.Attributes["id"] != null) 
             {
                 unitIDRef_ = unitNode.Attributes["id"].Value;
                 XsdTypeDouble ob = new XsdTypeDouble(unitNode);
                 IDManager.SetID(unitIDRef_, ob);
             }
             else if (unitNode.Attributes["href"] != null)
             {
                 unitIDRef_ = unitNode.Attributes["href"].Value;
             }
             else
             {
                 unit_ = new XsdTypeDouble(unitNode);
             }
         }
         else
         {
             unit_ = new XsdTypeDouble(unitNode);
         }
     }
     
 
     XmlNode baseCouponNode = xmlNode.SelectSingleNode("baseCoupon");
     
     if (baseCouponNode != null)
     {
         if (baseCouponNode.Attributes["href"] != null || baseCouponNode.Attributes["id"] != null) 
         {
             if (baseCouponNode.Attributes["id"] != null) 
             {
                 baseCouponIDRef_ = baseCouponNode.Attributes["id"].Value;
                 XsdTypeDouble ob = new XsdTypeDouble(baseCouponNode);
                 IDManager.SetID(baseCouponIDRef_, ob);
             }
             else if (baseCouponNode.Attributes["href"] != null)
             {
                 baseCouponIDRef_ = baseCouponNode.Attributes["href"].Value;
             }
             else
             {
                 baseCoupon_ = new XsdTypeDouble(baseCouponNode);
             }
         }
         else
         {
             baseCoupon_ = new XsdTypeDouble(baseCouponNode);
         }
     }
     
 
     XmlNode typeNode = xmlNode.SelectSingleNode("type");
     
     if (typeNode != null)
     {
         if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null) 
         {
             if (typeNode.Attributes["id"] != null) 
             {
                 typeIDRef_ = typeNode.Attributes["id"].Value;
                 XsdTypeToken ob = new XsdTypeToken(typeNode);
                 IDManager.SetID(typeIDRef_, ob);
             }
             else if (typeNode.Attributes["href"] != null)
             {
                 typeIDRef_ = typeNode.Attributes["href"].Value;
             }
             else
             {
                 type_ = new XsdTypeToken(typeNode);
             }
         }
         else
         {
             type_ = new XsdTypeToken(typeNode);
         }
     }
     
 
     XmlNode singleBarrierNode = xmlNode.SelectSingleNode("singleBarrier");
     
     if (singleBarrierNode != null)
     {
         if (singleBarrierNode.Attributes["href"] != null || singleBarrierNode.Attributes["id"] != null) 
         {
             if (singleBarrierNode.Attributes["id"] != null) 
             {
                 singleBarrierIDRef_ = singleBarrierNode.Attributes["id"].Value;
                 SingleBarrier ob = new SingleBarrier(singleBarrierNode);
                 IDManager.SetID(singleBarrierIDRef_, ob);
             }
             else if (singleBarrierNode.Attributes["href"] != null)
             {
                 singleBarrierIDRef_ = singleBarrierNode.Attributes["href"].Value;
             }
             else
             {
                 singleBarrier_ = new SingleBarrier(singleBarrierNode);
             }
         }
         else
         {
             singleBarrier_ = new SingleBarrier(singleBarrierNode);
         }
     }
     
 
     XmlNode vanillaCallOptionNode = xmlNode.SelectSingleNode("vanillaCallOption");
     
     if (vanillaCallOptionNode != null)
     {
         if (vanillaCallOptionNode.Attributes["href"] != null || vanillaCallOptionNode.Attributes["id"] != null) 
         {
             if (vanillaCallOptionNode.Attributes["id"] != null) 
             {
                 vanillaCallOptionIDRef_ = vanillaCallOptionNode.Attributes["id"].Value;
                 VanillaCallOption ob = new VanillaCallOption(vanillaCallOptionNode);
                 IDManager.SetID(vanillaCallOptionIDRef_, ob);
             }
             else if (vanillaCallOptionNode.Attributes["href"] != null)
             {
                 vanillaCallOptionIDRef_ = vanillaCallOptionNode.Attributes["href"].Value;
             }
             else
             {
                 vanillaCallOption_ = new VanillaCallOption(vanillaCallOptionNode);
             }
         }
         else
         {
             vanillaCallOption_ = new VanillaCallOption(vanillaCallOptionNode);
         }
     }
     
 
     XmlNode vanillaPutOptionNode = xmlNode.SelectSingleNode("vanillaPutOption");
     
     if (vanillaPutOptionNode != null)
     {
         if (vanillaPutOptionNode.Attributes["href"] != null || vanillaPutOptionNode.Attributes["id"] != null) 
         {
             if (vanillaPutOptionNode.Attributes["id"] != null) 
             {
                 vanillaPutOptionIDRef_ = vanillaPutOptionNode.Attributes["id"].Value;
                 VanillaPutOption ob = new VanillaPutOption(vanillaPutOptionNode);
                 IDManager.SetID(vanillaPutOptionIDRef_, ob);
             }
             else if (vanillaPutOptionNode.Attributes["href"] != null)
             {
                 vanillaPutOptionIDRef_ = vanillaPutOptionNode.Attributes["href"].Value;
             }
             else
             {
                 vanillaPutOption_ = new VanillaPutOption(vanillaPutOptionNode);
             }
         }
         else
         {
             vanillaPutOption_ = new VanillaPutOption(vanillaPutOptionNode);
         }
     }
     
 
     XmlNode barrierWithConstRebateCallOptionNode = xmlNode.SelectSingleNode("barrierWithConstRebateCallOption");
     
     if (barrierWithConstRebateCallOptionNode != null)
     {
         if (barrierWithConstRebateCallOptionNode.Attributes["href"] != null || barrierWithConstRebateCallOptionNode.Attributes["id"] != null) 
         {
             if (barrierWithConstRebateCallOptionNode.Attributes["id"] != null) 
             {
                 barrierWithConstRebateCallOptionIDRef_ = barrierWithConstRebateCallOptionNode.Attributes["id"].Value;
                 BarrierWithConstRebateCallOption ob = new BarrierWithConstRebateCallOption(barrierWithConstRebateCallOptionNode);
                 IDManager.SetID(barrierWithConstRebateCallOptionIDRef_, ob);
             }
             else if (barrierWithConstRebateCallOptionNode.Attributes["href"] != null)
             {
                 barrierWithConstRebateCallOptionIDRef_ = barrierWithConstRebateCallOptionNode.Attributes["href"].Value;
             }
             else
             {
                 barrierWithConstRebateCallOption_ = new BarrierWithConstRebateCallOption(barrierWithConstRebateCallOptionNode);
             }
         }
         else
         {
             barrierWithConstRebateCallOption_ = new BarrierWithConstRebateCallOption(barrierWithConstRebateCallOptionNode);
         }
     }
     
 
     XmlNode barrierWithConstRebatePutOptionNode = xmlNode.SelectSingleNode("barrierWithConstRebatePutOption");
     
     if (barrierWithConstRebatePutOptionNode != null)
     {
         if (barrierWithConstRebatePutOptionNode.Attributes["href"] != null || barrierWithConstRebatePutOptionNode.Attributes["id"] != null) 
         {
             if (barrierWithConstRebatePutOptionNode.Attributes["id"] != null) 
             {
                 barrierWithConstRebatePutOptionIDRef_ = barrierWithConstRebatePutOptionNode.Attributes["id"].Value;
                 BarrierWithConstRebatePutOption ob = new BarrierWithConstRebatePutOption(barrierWithConstRebatePutOptionNode);
                 IDManager.SetID(barrierWithConstRebatePutOptionIDRef_, ob);
             }
             else if (barrierWithConstRebatePutOptionNode.Attributes["href"] != null)
             {
                 barrierWithConstRebatePutOptionIDRef_ = barrierWithConstRebatePutOptionNode.Attributes["href"].Value;
             }
             else
             {
                 barrierWithConstRebatePutOption_ = new BarrierWithConstRebatePutOption(barrierWithConstRebatePutOptionNode);
             }
         }
         else
         {
             barrierWithConstRebatePutOption_ = new BarrierWithConstRebatePutOption(barrierWithConstRebatePutOptionNode);
         }
     }
     
 
 }
Beispiel #2
0
        public StandardOption(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode unitNode = xmlNode.SelectSingleNode("unit");

            if (unitNode != null)
            {
                if (unitNode.Attributes["href"] != null || unitNode.Attributes["id"] != null)
                {
                    if (unitNode.Attributes["id"] != null)
                    {
                        unitIDRef_ = unitNode.Attributes["id"].Value;
                        XsdTypeDouble ob = new XsdTypeDouble(unitNode);
                        IDManager.SetID(unitIDRef_, ob);
                    }
                    else if (unitNode.Attributes["href"] != null)
                    {
                        unitIDRef_ = unitNode.Attributes["href"].Value;
                    }
                    else
                    {
                        unit_ = new XsdTypeDouble(unitNode);
                    }
                }
                else
                {
                    unit_ = new XsdTypeDouble(unitNode);
                }
            }


            XmlNode baseCouponNode = xmlNode.SelectSingleNode("baseCoupon");

            if (baseCouponNode != null)
            {
                if (baseCouponNode.Attributes["href"] != null || baseCouponNode.Attributes["id"] != null)
                {
                    if (baseCouponNode.Attributes["id"] != null)
                    {
                        baseCouponIDRef_ = baseCouponNode.Attributes["id"].Value;
                        XsdTypeDouble ob = new XsdTypeDouble(baseCouponNode);
                        IDManager.SetID(baseCouponIDRef_, ob);
                    }
                    else if (baseCouponNode.Attributes["href"] != null)
                    {
                        baseCouponIDRef_ = baseCouponNode.Attributes["href"].Value;
                    }
                    else
                    {
                        baseCoupon_ = new XsdTypeDouble(baseCouponNode);
                    }
                }
                else
                {
                    baseCoupon_ = new XsdTypeDouble(baseCouponNode);
                }
            }


            XmlNode typeNode = xmlNode.SelectSingleNode("type");

            if (typeNode != null)
            {
                if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null)
                {
                    if (typeNode.Attributes["id"] != null)
                    {
                        typeIDRef_ = typeNode.Attributes["id"].Value;
                        XsdTypeToken ob = new XsdTypeToken(typeNode);
                        IDManager.SetID(typeIDRef_, ob);
                    }
                    else if (typeNode.Attributes["href"] != null)
                    {
                        typeIDRef_ = typeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        type_ = new XsdTypeToken(typeNode);
                    }
                }
                else
                {
                    type_ = new XsdTypeToken(typeNode);
                }
            }


            XmlNode singleBarrierNode = xmlNode.SelectSingleNode("singleBarrier");

            if (singleBarrierNode != null)
            {
                if (singleBarrierNode.Attributes["href"] != null || singleBarrierNode.Attributes["id"] != null)
                {
                    if (singleBarrierNode.Attributes["id"] != null)
                    {
                        singleBarrierIDRef_ = singleBarrierNode.Attributes["id"].Value;
                        SingleBarrier ob = new SingleBarrier(singleBarrierNode);
                        IDManager.SetID(singleBarrierIDRef_, ob);
                    }
                    else if (singleBarrierNode.Attributes["href"] != null)
                    {
                        singleBarrierIDRef_ = singleBarrierNode.Attributes["href"].Value;
                    }
                    else
                    {
                        singleBarrier_ = new SingleBarrier(singleBarrierNode);
                    }
                }
                else
                {
                    singleBarrier_ = new SingleBarrier(singleBarrierNode);
                }
            }


            XmlNode vanillaCallOptionNode = xmlNode.SelectSingleNode("vanillaCallOption");

            if (vanillaCallOptionNode != null)
            {
                if (vanillaCallOptionNode.Attributes["href"] != null || vanillaCallOptionNode.Attributes["id"] != null)
                {
                    if (vanillaCallOptionNode.Attributes["id"] != null)
                    {
                        vanillaCallOptionIDRef_ = vanillaCallOptionNode.Attributes["id"].Value;
                        VanillaCallOption ob = new VanillaCallOption(vanillaCallOptionNode);
                        IDManager.SetID(vanillaCallOptionIDRef_, ob);
                    }
                    else if (vanillaCallOptionNode.Attributes["href"] != null)
                    {
                        vanillaCallOptionIDRef_ = vanillaCallOptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        vanillaCallOption_ = new VanillaCallOption(vanillaCallOptionNode);
                    }
                }
                else
                {
                    vanillaCallOption_ = new VanillaCallOption(vanillaCallOptionNode);
                }
            }


            XmlNode vanillaPutOptionNode = xmlNode.SelectSingleNode("vanillaPutOption");

            if (vanillaPutOptionNode != null)
            {
                if (vanillaPutOptionNode.Attributes["href"] != null || vanillaPutOptionNode.Attributes["id"] != null)
                {
                    if (vanillaPutOptionNode.Attributes["id"] != null)
                    {
                        vanillaPutOptionIDRef_ = vanillaPutOptionNode.Attributes["id"].Value;
                        VanillaPutOption ob = new VanillaPutOption(vanillaPutOptionNode);
                        IDManager.SetID(vanillaPutOptionIDRef_, ob);
                    }
                    else if (vanillaPutOptionNode.Attributes["href"] != null)
                    {
                        vanillaPutOptionIDRef_ = vanillaPutOptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        vanillaPutOption_ = new VanillaPutOption(vanillaPutOptionNode);
                    }
                }
                else
                {
                    vanillaPutOption_ = new VanillaPutOption(vanillaPutOptionNode);
                }
            }


            XmlNode barrierWithConstRebateCallOptionNode = xmlNode.SelectSingleNode("barrierWithConstRebateCallOption");

            if (barrierWithConstRebateCallOptionNode != null)
            {
                if (barrierWithConstRebateCallOptionNode.Attributes["href"] != null || barrierWithConstRebateCallOptionNode.Attributes["id"] != null)
                {
                    if (barrierWithConstRebateCallOptionNode.Attributes["id"] != null)
                    {
                        barrierWithConstRebateCallOptionIDRef_ = barrierWithConstRebateCallOptionNode.Attributes["id"].Value;
                        BarrierWithConstRebateCallOption ob = new BarrierWithConstRebateCallOption(barrierWithConstRebateCallOptionNode);
                        IDManager.SetID(barrierWithConstRebateCallOptionIDRef_, ob);
                    }
                    else if (barrierWithConstRebateCallOptionNode.Attributes["href"] != null)
                    {
                        barrierWithConstRebateCallOptionIDRef_ = barrierWithConstRebateCallOptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        barrierWithConstRebateCallOption_ = new BarrierWithConstRebateCallOption(barrierWithConstRebateCallOptionNode);
                    }
                }
                else
                {
                    barrierWithConstRebateCallOption_ = new BarrierWithConstRebateCallOption(barrierWithConstRebateCallOptionNode);
                }
            }


            XmlNode barrierWithConstRebatePutOptionNode = xmlNode.SelectSingleNode("barrierWithConstRebatePutOption");

            if (barrierWithConstRebatePutOptionNode != null)
            {
                if (barrierWithConstRebatePutOptionNode.Attributes["href"] != null || barrierWithConstRebatePutOptionNode.Attributes["id"] != null)
                {
                    if (barrierWithConstRebatePutOptionNode.Attributes["id"] != null)
                    {
                        barrierWithConstRebatePutOptionIDRef_ = barrierWithConstRebatePutOptionNode.Attributes["id"].Value;
                        BarrierWithConstRebatePutOption ob = new BarrierWithConstRebatePutOption(barrierWithConstRebatePutOptionNode);
                        IDManager.SetID(barrierWithConstRebatePutOptionIDRef_, ob);
                    }
                    else if (barrierWithConstRebatePutOptionNode.Attributes["href"] != null)
                    {
                        barrierWithConstRebatePutOptionIDRef_ = barrierWithConstRebatePutOptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        barrierWithConstRebatePutOption_ = new BarrierWithConstRebatePutOption(barrierWithConstRebatePutOptionNode);
                    }
                }
                else
                {
                    barrierWithConstRebatePutOption_ = new BarrierWithConstRebatePutOption(barrierWithConstRebatePutOptionNode);
                }
            }
        }