Exemple #1
0
        public OptionPayoffFunction(XmlNode xmlNode)
            : base(xmlNode)
        {
            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 vanillaCallFunctionNode = xmlNode.SelectSingleNode("vanillaCallFunction");

            if (vanillaCallFunctionNode != null)
            {
                if (vanillaCallFunctionNode.Attributes["href"] != null || vanillaCallFunctionNode.Attributes["id"] != null)
                {
                    if (vanillaCallFunctionNode.Attributes["id"] != null)
                    {
                        vanillaCallFunctionIDRef_ = vanillaCallFunctionNode.Attributes["id"].Value;
                        VanillaCallFunction ob = new VanillaCallFunction(vanillaCallFunctionNode);
                        IDManager.SetID(vanillaCallFunctionIDRef_, ob);
                    }
                    else if (vanillaCallFunctionNode.Attributes["href"] != null)
                    {
                        vanillaCallFunctionIDRef_ = vanillaCallFunctionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        vanillaCallFunction_ = new VanillaCallFunction(vanillaCallFunctionNode);
                    }
                }
                else
                {
                    vanillaCallFunction_ = new VanillaCallFunction(vanillaCallFunctionNode);
                }
            }


            XmlNode vanillaPutFunctionNode = xmlNode.SelectSingleNode("vanillaPutFunction");

            if (vanillaPutFunctionNode != null)
            {
                if (vanillaPutFunctionNode.Attributes["href"] != null || vanillaPutFunctionNode.Attributes["id"] != null)
                {
                    if (vanillaPutFunctionNode.Attributes["id"] != null)
                    {
                        vanillaPutFunctionIDRef_ = vanillaPutFunctionNode.Attributes["id"].Value;
                        VanillaPutFunction ob = new VanillaPutFunction(vanillaPutFunctionNode);
                        IDManager.SetID(vanillaPutFunctionIDRef_, ob);
                    }
                    else if (vanillaPutFunctionNode.Attributes["href"] != null)
                    {
                        vanillaPutFunctionIDRef_ = vanillaPutFunctionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        vanillaPutFunction_ = new VanillaPutFunction(vanillaPutFunctionNode);
                    }
                }
                else
                {
                    vanillaPutFunction_ = new VanillaPutFunction(vanillaPutFunctionNode);
                }
            }
        }
 public OptionPayoffFunction(XmlNode xmlNode)
 : base(xmlNode)
 {
     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 vanillaCallFunctionNode = xmlNode.SelectSingleNode("vanillaCallFunction");
     
     if (vanillaCallFunctionNode != null)
     {
         if (vanillaCallFunctionNode.Attributes["href"] != null || vanillaCallFunctionNode.Attributes["id"] != null) 
         {
             if (vanillaCallFunctionNode.Attributes["id"] != null) 
             {
                 vanillaCallFunctionIDRef_ = vanillaCallFunctionNode.Attributes["id"].Value;
                 VanillaCallFunction ob = new VanillaCallFunction(vanillaCallFunctionNode);
                 IDManager.SetID(vanillaCallFunctionIDRef_, ob);
             }
             else if (vanillaCallFunctionNode.Attributes["href"] != null)
             {
                 vanillaCallFunctionIDRef_ = vanillaCallFunctionNode.Attributes["href"].Value;
             }
             else
             {
                 vanillaCallFunction_ = new VanillaCallFunction(vanillaCallFunctionNode);
             }
         }
         else
         {
             vanillaCallFunction_ = new VanillaCallFunction(vanillaCallFunctionNode);
         }
     }
     
 
     XmlNode vanillaPutFunctionNode = xmlNode.SelectSingleNode("vanillaPutFunction");
     
     if (vanillaPutFunctionNode != null)
     {
         if (vanillaPutFunctionNode.Attributes["href"] != null || vanillaPutFunctionNode.Attributes["id"] != null) 
         {
             if (vanillaPutFunctionNode.Attributes["id"] != null) 
             {
                 vanillaPutFunctionIDRef_ = vanillaPutFunctionNode.Attributes["id"].Value;
                 VanillaPutFunction ob = new VanillaPutFunction(vanillaPutFunctionNode);
                 IDManager.SetID(vanillaPutFunctionIDRef_, ob);
             }
             else if (vanillaPutFunctionNode.Attributes["href"] != null)
             {
                 vanillaPutFunctionIDRef_ = vanillaPutFunctionNode.Attributes["href"].Value;
             }
             else
             {
                 vanillaPutFunction_ = new VanillaPutFunction(vanillaPutFunctionNode);
             }
         }
         else
         {
             vanillaPutFunction_ = new VanillaPutFunction(vanillaPutFunctionNode);
         }
     }
     
 
 }