public EventCalculation(XmlNode xmlNode)
 : base(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;
                 XsdTypeToken ob = new XsdTypeToken(nameNode);
                 IDManager.SetID(nameIDRef_, ob);
             }
             else if (nameNode.Attributes["href"] != null)
             {
                 nameIDRef_ = nameNode.Attributes["href"].Value;
             }
             else
             {
                 name_ = new XsdTypeToken(nameNode);
             }
         }
         else
         {
             name_ = new XsdTypeToken(nameNode);
         }
     }
     
 
     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 preConditionEventNode = xmlNode.SelectSingleNode("preConditionEvent");
     
     if (preConditionEventNode != null)
     {
         if (preConditionEventNode.Attributes["href"] != null || preConditionEventNode.Attributes["id"] != null) 
         {
             if (preConditionEventNode.Attributes["id"] != null) 
             {
                 preConditionEventIDRef_ = preConditionEventNode.Attributes["id"].Value;
                 PreConditionEvent ob = new PreConditionEvent(preConditionEventNode);
                 IDManager.SetID(preConditionEventIDRef_, ob);
             }
             else if (preConditionEventNode.Attributes["href"] != null)
             {
                 preConditionEventIDRef_ = preConditionEventNode.Attributes["href"].Value;
             }
             else
             {
                 preConditionEvent_ = new PreConditionEvent(preConditionEventNode);
             }
         }
         else
         {
             preConditionEvent_ = new PreConditionEvent(preConditionEventNode);
         }
     }
     
 
     XmlNode upperBarrierEventCalNode = xmlNode.SelectSingleNode("upperBarrierEventCal");
     
     if (upperBarrierEventCalNode != null)
     {
         if (upperBarrierEventCalNode.Attributes["href"] != null || upperBarrierEventCalNode.Attributes["id"] != null) 
         {
             if (upperBarrierEventCalNode.Attributes["id"] != null) 
             {
                 upperBarrierEventCalIDRef_ = upperBarrierEventCalNode.Attributes["id"].Value;
                 UpperBarrierEventCal ob = new UpperBarrierEventCal(upperBarrierEventCalNode);
                 IDManager.SetID(upperBarrierEventCalIDRef_, ob);
             }
             else if (upperBarrierEventCalNode.Attributes["href"] != null)
             {
                 upperBarrierEventCalIDRef_ = upperBarrierEventCalNode.Attributes["href"].Value;
             }
             else
             {
                 upperBarrierEventCal_ = new UpperBarrierEventCal(upperBarrierEventCalNode);
             }
         }
         else
         {
             upperBarrierEventCal_ = new UpperBarrierEventCal(upperBarrierEventCalNode);
         }
     }
     
 
     XmlNode lowerBarrierEventCalNode = xmlNode.SelectSingleNode("lowerBarrierEventCal");
     
     if (lowerBarrierEventCalNode != null)
     {
         if (lowerBarrierEventCalNode.Attributes["href"] != null || lowerBarrierEventCalNode.Attributes["id"] != null) 
         {
             if (lowerBarrierEventCalNode.Attributes["id"] != null) 
             {
                 lowerBarrierEventCalIDRef_ = lowerBarrierEventCalNode.Attributes["id"].Value;
                 LowerBarrierEventCal ob = new LowerBarrierEventCal(lowerBarrierEventCalNode);
                 IDManager.SetID(lowerBarrierEventCalIDRef_, ob);
             }
             else if (lowerBarrierEventCalNode.Attributes["href"] != null)
             {
                 lowerBarrierEventCalIDRef_ = lowerBarrierEventCalNode.Attributes["href"].Value;
             }
             else
             {
                 lowerBarrierEventCal_ = new LowerBarrierEventCal(lowerBarrierEventCalNode);
             }
         }
         else
         {
             lowerBarrierEventCal_ = new LowerBarrierEventCal(lowerBarrierEventCalNode);
         }
     }
     
 
     XmlNode dualBarrierEventCalNode = xmlNode.SelectSingleNode("dualBarrierEventCal");
     
     if (dualBarrierEventCalNode != null)
     {
         if (dualBarrierEventCalNode.Attributes["href"] != null || dualBarrierEventCalNode.Attributes["id"] != null) 
         {
             if (dualBarrierEventCalNode.Attributes["id"] != null) 
             {
                 dualBarrierEventCalIDRef_ = dualBarrierEventCalNode.Attributes["id"].Value;
                 DualBarrierEventCal ob = new DualBarrierEventCal(dualBarrierEventCalNode);
                 IDManager.SetID(dualBarrierEventCalIDRef_, ob);
             }
             else if (dualBarrierEventCalNode.Attributes["href"] != null)
             {
                 dualBarrierEventCalIDRef_ = dualBarrierEventCalNode.Attributes["href"].Value;
             }
             else
             {
                 dualBarrierEventCal_ = new DualBarrierEventCal(dualBarrierEventCalNode);
             }
         }
         else
         {
             dualBarrierEventCal_ = new DualBarrierEventCal(dualBarrierEventCalNode);
         }
     }
     
 
     XmlNode simpleRangeEventCalNode = xmlNode.SelectSingleNode("simpleRangeEventCal");
     
     if (simpleRangeEventCalNode != null)
     {
         if (simpleRangeEventCalNode.Attributes["href"] != null || simpleRangeEventCalNode.Attributes["id"] != null) 
         {
             if (simpleRangeEventCalNode.Attributes["id"] != null) 
             {
                 simpleRangeEventCalIDRef_ = simpleRangeEventCalNode.Attributes["id"].Value;
                 SimpleRangeEventCal ob = new SimpleRangeEventCal(simpleRangeEventCalNode);
                 IDManager.SetID(simpleRangeEventCalIDRef_, ob);
             }
             else if (simpleRangeEventCalNode.Attributes["href"] != null)
             {
                 simpleRangeEventCalIDRef_ = simpleRangeEventCalNode.Attributes["href"].Value;
             }
             else
             {
                 simpleRangeEventCal_ = new SimpleRangeEventCal(simpleRangeEventCalNode);
             }
         }
         else
         {
             simpleRangeEventCal_ = new SimpleRangeEventCal(simpleRangeEventCalNode);
         }
     }
     
 
     XmlNode referenceEventCalNode = xmlNode.SelectSingleNode("referenceEventCal");
     
     if (referenceEventCalNode != null)
     {
         if (referenceEventCalNode.Attributes["href"] != null || referenceEventCalNode.Attributes["id"] != null) 
         {
             if (referenceEventCalNode.Attributes["id"] != null) 
             {
                 referenceEventCalIDRef_ = referenceEventCalNode.Attributes["id"].Value;
                 ReferenceEventCal ob = new ReferenceEventCal(referenceEventCalNode);
                 IDManager.SetID(referenceEventCalIDRef_, ob);
             }
             else if (referenceEventCalNode.Attributes["href"] != null)
             {
                 referenceEventCalIDRef_ = referenceEventCalNode.Attributes["href"].Value;
             }
             else
             {
                 referenceEventCal_ = new ReferenceEventCal(referenceEventCalNode);
             }
         }
         else
         {
             referenceEventCal_ = new ReferenceEventCal(referenceEventCalNode);
         }
     }
     
 
     XmlNode pastEventOccNode = xmlNode.SelectSingleNode("pastEventOcc");
     
     if (pastEventOccNode != null)
     {
         if (pastEventOccNode.Attributes["href"] != null || pastEventOccNode.Attributes["id"] != null) 
         {
             if (pastEventOccNode.Attributes["id"] != null) 
             {
                 pastEventOccIDRef_ = pastEventOccNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(pastEventOccNode);
                 IDManager.SetID(pastEventOccIDRef_, ob);
             }
             else if (pastEventOccNode.Attributes["href"] != null)
             {
                 pastEventOccIDRef_ = pastEventOccNode.Attributes["href"].Value;
             }
             else
             {
                 pastEventOcc_ = new XsdTypeBoolean(pastEventOccNode);
             }
         }
         else
         {
             pastEventOcc_ = new XsdTypeBoolean(pastEventOccNode);
         }
     }
     
 
     XmlNode refVariable_eventOccNode = xmlNode.SelectSingleNode("refVariable_eventOcc");
     
     if (refVariable_eventOccNode != null)
     {
         if (refVariable_eventOccNode.Attributes["href"] != null || refVariable_eventOccNode.Attributes["id"] != null) 
         {
             if (refVariable_eventOccNode.Attributes["id"] != null) 
             {
                 refVariable_eventOccIDRef_ = refVariable_eventOccNode.Attributes["id"].Value;
                 RefVariable_eventOcc ob = new RefVariable_eventOcc(refVariable_eventOccNode);
                 IDManager.SetID(refVariable_eventOccIDRef_, ob);
             }
             else if (refVariable_eventOccNode.Attributes["href"] != null)
             {
                 refVariable_eventOccIDRef_ = refVariable_eventOccNode.Attributes["href"].Value;
             }
             else
             {
                 refVariable_eventOcc_ = new RefVariable_eventOcc(refVariable_eventOccNode);
             }
         }
         else
         {
             refVariable_eventOcc_ = new RefVariable_eventOcc(refVariable_eventOccNode);
         }
     }
     
 
 }
        public EventCalculation(XmlNode xmlNode)
            : base(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;
                        XsdTypeToken ob = new XsdTypeToken(nameNode);
                        IDManager.SetID(nameIDRef_, ob);
                    }
                    else if (nameNode.Attributes["href"] != null)
                    {
                        nameIDRef_ = nameNode.Attributes["href"].Value;
                    }
                    else
                    {
                        name_ = new XsdTypeToken(nameNode);
                    }
                }
                else
                {
                    name_ = new XsdTypeToken(nameNode);
                }
            }


            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 preConditionEventNode = xmlNode.SelectSingleNode("preConditionEvent");

            if (preConditionEventNode != null)
            {
                if (preConditionEventNode.Attributes["href"] != null || preConditionEventNode.Attributes["id"] != null)
                {
                    if (preConditionEventNode.Attributes["id"] != null)
                    {
                        preConditionEventIDRef_ = preConditionEventNode.Attributes["id"].Value;
                        PreConditionEvent ob = new PreConditionEvent(preConditionEventNode);
                        IDManager.SetID(preConditionEventIDRef_, ob);
                    }
                    else if (preConditionEventNode.Attributes["href"] != null)
                    {
                        preConditionEventIDRef_ = preConditionEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        preConditionEvent_ = new PreConditionEvent(preConditionEventNode);
                    }
                }
                else
                {
                    preConditionEvent_ = new PreConditionEvent(preConditionEventNode);
                }
            }


            XmlNode upperBarrierEventCalNode = xmlNode.SelectSingleNode("upperBarrierEventCal");

            if (upperBarrierEventCalNode != null)
            {
                if (upperBarrierEventCalNode.Attributes["href"] != null || upperBarrierEventCalNode.Attributes["id"] != null)
                {
                    if (upperBarrierEventCalNode.Attributes["id"] != null)
                    {
                        upperBarrierEventCalIDRef_ = upperBarrierEventCalNode.Attributes["id"].Value;
                        UpperBarrierEventCal ob = new UpperBarrierEventCal(upperBarrierEventCalNode);
                        IDManager.SetID(upperBarrierEventCalIDRef_, ob);
                    }
                    else if (upperBarrierEventCalNode.Attributes["href"] != null)
                    {
                        upperBarrierEventCalIDRef_ = upperBarrierEventCalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        upperBarrierEventCal_ = new UpperBarrierEventCal(upperBarrierEventCalNode);
                    }
                }
                else
                {
                    upperBarrierEventCal_ = new UpperBarrierEventCal(upperBarrierEventCalNode);
                }
            }


            XmlNode lowerBarrierEventCalNode = xmlNode.SelectSingleNode("lowerBarrierEventCal");

            if (lowerBarrierEventCalNode != null)
            {
                if (lowerBarrierEventCalNode.Attributes["href"] != null || lowerBarrierEventCalNode.Attributes["id"] != null)
                {
                    if (lowerBarrierEventCalNode.Attributes["id"] != null)
                    {
                        lowerBarrierEventCalIDRef_ = lowerBarrierEventCalNode.Attributes["id"].Value;
                        LowerBarrierEventCal ob = new LowerBarrierEventCal(lowerBarrierEventCalNode);
                        IDManager.SetID(lowerBarrierEventCalIDRef_, ob);
                    }
                    else if (lowerBarrierEventCalNode.Attributes["href"] != null)
                    {
                        lowerBarrierEventCalIDRef_ = lowerBarrierEventCalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        lowerBarrierEventCal_ = new LowerBarrierEventCal(lowerBarrierEventCalNode);
                    }
                }
                else
                {
                    lowerBarrierEventCal_ = new LowerBarrierEventCal(lowerBarrierEventCalNode);
                }
            }


            XmlNode dualBarrierEventCalNode = xmlNode.SelectSingleNode("dualBarrierEventCal");

            if (dualBarrierEventCalNode != null)
            {
                if (dualBarrierEventCalNode.Attributes["href"] != null || dualBarrierEventCalNode.Attributes["id"] != null)
                {
                    if (dualBarrierEventCalNode.Attributes["id"] != null)
                    {
                        dualBarrierEventCalIDRef_ = dualBarrierEventCalNode.Attributes["id"].Value;
                        DualBarrierEventCal ob = new DualBarrierEventCal(dualBarrierEventCalNode);
                        IDManager.SetID(dualBarrierEventCalIDRef_, ob);
                    }
                    else if (dualBarrierEventCalNode.Attributes["href"] != null)
                    {
                        dualBarrierEventCalIDRef_ = dualBarrierEventCalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dualBarrierEventCal_ = new DualBarrierEventCal(dualBarrierEventCalNode);
                    }
                }
                else
                {
                    dualBarrierEventCal_ = new DualBarrierEventCal(dualBarrierEventCalNode);
                }
            }


            XmlNode simpleRangeEventCalNode = xmlNode.SelectSingleNode("simpleRangeEventCal");

            if (simpleRangeEventCalNode != null)
            {
                if (simpleRangeEventCalNode.Attributes["href"] != null || simpleRangeEventCalNode.Attributes["id"] != null)
                {
                    if (simpleRangeEventCalNode.Attributes["id"] != null)
                    {
                        simpleRangeEventCalIDRef_ = simpleRangeEventCalNode.Attributes["id"].Value;
                        SimpleRangeEventCal ob = new SimpleRangeEventCal(simpleRangeEventCalNode);
                        IDManager.SetID(simpleRangeEventCalIDRef_, ob);
                    }
                    else if (simpleRangeEventCalNode.Attributes["href"] != null)
                    {
                        simpleRangeEventCalIDRef_ = simpleRangeEventCalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        simpleRangeEventCal_ = new SimpleRangeEventCal(simpleRangeEventCalNode);
                    }
                }
                else
                {
                    simpleRangeEventCal_ = new SimpleRangeEventCal(simpleRangeEventCalNode);
                }
            }


            XmlNode referenceEventCalNode = xmlNode.SelectSingleNode("referenceEventCal");

            if (referenceEventCalNode != null)
            {
                if (referenceEventCalNode.Attributes["href"] != null || referenceEventCalNode.Attributes["id"] != null)
                {
                    if (referenceEventCalNode.Attributes["id"] != null)
                    {
                        referenceEventCalIDRef_ = referenceEventCalNode.Attributes["id"].Value;
                        ReferenceEventCal ob = new ReferenceEventCal(referenceEventCalNode);
                        IDManager.SetID(referenceEventCalIDRef_, ob);
                    }
                    else if (referenceEventCalNode.Attributes["href"] != null)
                    {
                        referenceEventCalIDRef_ = referenceEventCalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        referenceEventCal_ = new ReferenceEventCal(referenceEventCalNode);
                    }
                }
                else
                {
                    referenceEventCal_ = new ReferenceEventCal(referenceEventCalNode);
                }
            }


            XmlNode pastEventOccNode = xmlNode.SelectSingleNode("pastEventOcc");

            if (pastEventOccNode != null)
            {
                if (pastEventOccNode.Attributes["href"] != null || pastEventOccNode.Attributes["id"] != null)
                {
                    if (pastEventOccNode.Attributes["id"] != null)
                    {
                        pastEventOccIDRef_ = pastEventOccNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(pastEventOccNode);
                        IDManager.SetID(pastEventOccIDRef_, ob);
                    }
                    else if (pastEventOccNode.Attributes["href"] != null)
                    {
                        pastEventOccIDRef_ = pastEventOccNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pastEventOcc_ = new XsdTypeBoolean(pastEventOccNode);
                    }
                }
                else
                {
                    pastEventOcc_ = new XsdTypeBoolean(pastEventOccNode);
                }
            }


            XmlNode refVariable_eventOccNode = xmlNode.SelectSingleNode("refVariable_eventOcc");

            if (refVariable_eventOccNode != null)
            {
                if (refVariable_eventOccNode.Attributes["href"] != null || refVariable_eventOccNode.Attributes["id"] != null)
                {
                    if (refVariable_eventOccNode.Attributes["id"] != null)
                    {
                        refVariable_eventOccIDRef_ = refVariable_eventOccNode.Attributes["id"].Value;
                        RefVariable_eventOcc ob = new RefVariable_eventOcc(refVariable_eventOccNode);
                        IDManager.SetID(refVariable_eventOccIDRef_, ob);
                    }
                    else if (refVariable_eventOccNode.Attributes["href"] != null)
                    {
                        refVariable_eventOccIDRef_ = refVariable_eventOccNode.Attributes["href"].Value;
                    }
                    else
                    {
                        refVariable_eventOcc_ = new RefVariable_eventOcc(refVariable_eventOccNode);
                    }
                }
                else
                {
                    refVariable_eventOcc_ = new RefVariable_eventOcc(refVariable_eventOccNode);
                }
            }
        }