public OilPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");

            if (deliveryPeriodsNode != null)
            {
                if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                        CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                        IDManager.SetID(deliveryPeriodsIDRef_, ob);
                    }
                    else if (deliveryPeriodsNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                    }
                }
                else
                {
                    deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                }
            }


            XmlNode oilNode = xmlNode.SelectSingleNode("oil");

            if (oilNode != null)
            {
                if (oilNode.Attributes["href"] != null || oilNode.Attributes["id"] != null)
                {
                    if (oilNode.Attributes["id"] != null)
                    {
                        oilIDRef_ = oilNode.Attributes["id"].Value;
                        OilProduct ob = new OilProduct(oilNode);
                        IDManager.SetID(oilIDRef_, ob);
                    }
                    else if (oilNode.Attributes["href"] != null)
                    {
                        oilIDRef_ = oilNode.Attributes["href"].Value;
                    }
                    else
                    {
                        oil_ = new OilProduct(oilNode);
                    }
                }
                else
                {
                    oil_ = new OilProduct(oilNode);
                }
            }


            XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");

            if (deliveryConditionsNode != null)
            {
                if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null)
                {
                    if (deliveryConditionsNode.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                        OilDelivery ob = new OilDelivery(deliveryConditionsNode);
                        IDManager.SetID(deliveryConditionsIDRef_, ob);
                    }
                    else if (deliveryConditionsNode.Attributes["href"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryConditions_ = new OilDelivery(deliveryConditionsNode);
                    }
                }
                else
                {
                    deliveryConditions_ = new OilDelivery(deliveryConditionsNode);
                }
            }


            XmlNode deliveryQuantityNode = xmlNode.SelectSingleNode("deliveryQuantity");

            if (deliveryQuantityNode != null)
            {
                if (deliveryQuantityNode.Attributes["href"] != null || deliveryQuantityNode.Attributes["id"] != null)
                {
                    if (deliveryQuantityNode.Attributes["id"] != null)
                    {
                        deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["id"].Value;
                        CommodityPhysicalQuantity ob = new CommodityPhysicalQuantity(deliveryQuantityNode);
                        IDManager.SetID(deliveryQuantityIDRef_, ob);
                    }
                    else if (deliveryQuantityNode.Attributes["href"] != null)
                    {
                        deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryQuantity_ = new CommodityPhysicalQuantity(deliveryQuantityNode);
                    }
                }
                else
                {
                    deliveryQuantity_ = new CommodityPhysicalQuantity(deliveryQuantityNode);
                }
            }
        }
Exemple #2
0
        public ElectricityPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");

            if (deliveryPeriodsNode != null)
            {
                if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                        CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                        IDManager.SetID(deliveryPeriodsIDRef_, ob);
                    }
                    else if (deliveryPeriodsNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                    }
                }
                else
                {
                    deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                }
            }


            XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");

            if (settlementPeriodsNodeList != null)
            {
                this.settlementPeriods_ = new List <SettlementPeriods>();
                foreach (XmlNode item in settlementPeriodsNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            settlementPeriodsIDRef_ = item.Attributes["id"].Value;
                            settlementPeriods_.Add(new SettlementPeriods(item));
                            IDManager.SetID(settlementPeriodsIDRef_, settlementPeriods_[settlementPeriods_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            settlementPeriodsIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            settlementPeriods_.Add(new SettlementPeriods(item));
                        }
                    }
                    else
                    {
                        settlementPeriods_.Add(new SettlementPeriods(item));
                    }
                }
            }


            XmlNode settlementPeriodsScheduleNode = xmlNode.SelectSingleNode("settlementPeriodsSchedule");

            if (settlementPeriodsScheduleNode != null)
            {
                if (settlementPeriodsScheduleNode.Attributes["href"] != null || settlementPeriodsScheduleNode.Attributes["id"] != null)
                {
                    if (settlementPeriodsScheduleNode.Attributes["id"] != null)
                    {
                        settlementPeriodsScheduleIDRef_ = settlementPeriodsScheduleNode.Attributes["id"].Value;
                        SettlementPeriodsSchedule ob = new SettlementPeriodsSchedule(settlementPeriodsScheduleNode);
                        IDManager.SetID(settlementPeriodsScheduleIDRef_, ob);
                    }
                    else if (settlementPeriodsScheduleNode.Attributes["href"] != null)
                    {
                        settlementPeriodsScheduleIDRef_ = settlementPeriodsScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementPeriodsSchedule_ = new SettlementPeriodsSchedule(settlementPeriodsScheduleNode);
                    }
                }
                else
                {
                    settlementPeriodsSchedule_ = new SettlementPeriodsSchedule(settlementPeriodsScheduleNode);
                }
            }


            XmlNode loadTypeNode = xmlNode.SelectSingleNode("loadType");

            if (loadTypeNode != null)
            {
                if (loadTypeNode.Attributes["href"] != null || loadTypeNode.Attributes["id"] != null)
                {
                    if (loadTypeNode.Attributes["id"] != null)
                    {
                        loadTypeIDRef_ = loadTypeNode.Attributes["id"].Value;
                        LoadTypeEnum ob = new LoadTypeEnum(loadTypeNode);
                        IDManager.SetID(loadTypeIDRef_, ob);
                    }
                    else if (loadTypeNode.Attributes["href"] != null)
                    {
                        loadTypeIDRef_ = loadTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        loadType_ = new LoadTypeEnum(loadTypeNode);
                    }
                }
                else
                {
                    loadType_ = new LoadTypeEnum(loadTypeNode);
                }
            }


            XmlNode electricityNode = xmlNode.SelectSingleNode("electricity");

            if (electricityNode != null)
            {
                if (electricityNode.Attributes["href"] != null || electricityNode.Attributes["id"] != null)
                {
                    if (electricityNode.Attributes["id"] != null)
                    {
                        electricityIDRef_ = electricityNode.Attributes["id"].Value;
                        ElectricityProduct ob = new ElectricityProduct(electricityNode);
                        IDManager.SetID(electricityIDRef_, ob);
                    }
                    else if (electricityNode.Attributes["href"] != null)
                    {
                        electricityIDRef_ = electricityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        electricity_ = new ElectricityProduct(electricityNode);
                    }
                }
                else
                {
                    electricity_ = new ElectricityProduct(electricityNode);
                }
            }


            XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");

            if (deliveryConditionsNode != null)
            {
                if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null)
                {
                    if (deliveryConditionsNode.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                        ElectricityDelivery ob = new ElectricityDelivery(deliveryConditionsNode);
                        IDManager.SetID(deliveryConditionsIDRef_, ob);
                    }
                    else if (deliveryConditionsNode.Attributes["href"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryConditions_ = new ElectricityDelivery(deliveryConditionsNode);
                    }
                }
                else
                {
                    deliveryConditions_ = new ElectricityDelivery(deliveryConditionsNode);
                }
            }


            XmlNode deliveryQuantityNode = xmlNode.SelectSingleNode("deliveryQuantity");

            if (deliveryQuantityNode != null)
            {
                if (deliveryQuantityNode.Attributes["href"] != null || deliveryQuantityNode.Attributes["id"] != null)
                {
                    if (deliveryQuantityNode.Attributes["id"] != null)
                    {
                        deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["id"].Value;
                        ElectricityPhysicalQuantity ob = new ElectricityPhysicalQuantity(deliveryQuantityNode);
                        IDManager.SetID(deliveryQuantityIDRef_, ob);
                    }
                    else if (deliveryQuantityNode.Attributes["href"] != null)
                    {
                        deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryQuantity_ = new ElectricityPhysicalQuantity(deliveryQuantityNode);
                    }
                }
                else
                {
                    deliveryQuantity_ = new ElectricityPhysicalQuantity(deliveryQuantityNode);
                }
            }
        }
        public MetalPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList metalNodeList = xmlNode.SelectNodes("metal");

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

            foreach (XmlNode item in metalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        metalIDRef = item.Attributes["id"].Name;
                        Metal ob = Metal();
                        IDManager.SetID(metalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        metalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        metal = new Metal(item);
                    }
                }
            }


            XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");

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

            foreach (XmlNode item in deliveryPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef = item.Attributes["id"].Name;
                        CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                        IDManager.SetID(deliveryPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryPeriods = new CommodityDeliveryPeriods(item);
                    }
                }
            }


            XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");

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

            foreach (XmlNode item in deliveryConditionsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef = item.Attributes["id"].Name;
                        MetalDelivery ob = MetalDelivery();
                        IDManager.SetID(deliveryConditionsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryConditionsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryConditions = new MetalDelivery(item);
                    }
                }
            }


            XmlNodeList physicalQuantityNodeList = xmlNode.SelectNodes("physicalQuantity");

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

            foreach (XmlNode item in physicalQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalQuantityIDRef = item.Attributes["id"].Name;
                        CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                        IDManager.SetID(physicalQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalQuantity = new CommodityNotionalQuantity(item);
                    }
                }
            }


            XmlNodeList physicalQuantityScheduleNodeList = xmlNode.SelectNodes("physicalQuantitySchedule");

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

            foreach (XmlNode item in physicalQuantityScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalQuantityScheduleIDRef = item.Attributes["id"].Name;
                        CommodityPhysicalQuantitySchedule ob = CommodityPhysicalQuantitySchedule();
                        IDManager.SetID(physicalQuantityScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalQuantityScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalQuantitySchedule = new CommodityPhysicalQuantitySchedule(item);
                    }
                }
            }


            XmlNodeList totalPhysicalQuantityNodeList = xmlNode.SelectNodes("totalPhysicalQuantity");

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

            foreach (XmlNode item in totalPhysicalQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        totalPhysicalQuantityIDRef = item.Attributes["id"].Name;
                        UnitQuantity ob = UnitQuantity();
                        IDManager.SetID(totalPhysicalQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        totalPhysicalQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        totalPhysicalQuantity = new UnitQuantity(item);
                    }
                }
            }


            XmlNodeList conversionFactorNodeList = xmlNode.SelectNodes("conversionFactor");

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

            foreach (XmlNode item in conversionFactorNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        conversionFactorIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(conversionFactorIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        conversionFactorIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        conversionFactor = new XsdTypeDecimal(item);
                    }
                }
            }
        }
        public OilPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");

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

            foreach (XmlNode item in deliveryPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef = item.Attributes["id"].Name;
                        CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                        IDManager.SetID(deliveryPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryPeriods = new CommodityDeliveryPeriods(item);
                    }
                }
            }


            XmlNodeList oilNodeList = xmlNode.SelectNodes("oil");

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

            foreach (XmlNode item in oilNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        oilIDRef = item.Attributes["id"].Name;
                        OilProduct ob = OilProduct();
                        IDManager.SetID(oilIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        oilIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        oil = new OilProduct(item);
                    }
                }
            }


            XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");

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

            foreach (XmlNode item in deliveryConditionsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef = item.Attributes["id"].Name;
                        OilDelivery ob = OilDelivery();
                        IDManager.SetID(deliveryConditionsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryConditionsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryConditions = new OilDelivery(item);
                    }
                }
            }


            XmlNodeList deliveryQuantityNodeList = xmlNode.SelectNodes("deliveryQuantity");

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

            foreach (XmlNode item in deliveryQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryQuantityIDRef = item.Attributes["id"].Name;
                        CommodityPhysicalQuantity ob = CommodityPhysicalQuantity();
                        IDManager.SetID(deliveryQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryQuantity = new CommodityPhysicalQuantity(item);
                    }
                }
            }
        }
 public MetalPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode metalNode = xmlNode.SelectSingleNode("metal");
     
     if (metalNode != null)
     {
         if (metalNode.Attributes["href"] != null || metalNode.Attributes["id"] != null) 
         {
             if (metalNode.Attributes["id"] != null) 
             {
                 metalIDRef_ = metalNode.Attributes["id"].Value;
                 Metal ob = new Metal(metalNode);
                 IDManager.SetID(metalIDRef_, ob);
             }
             else if (metalNode.Attributes["href"] != null)
             {
                 metalIDRef_ = metalNode.Attributes["href"].Value;
             }
             else
             {
                 metal_ = new Metal(metalNode);
             }
         }
         else
         {
             metal_ = new Metal(metalNode);
         }
     }
     
 
     XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");
     
     if (deliveryPeriodsNode != null)
     {
         if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                 CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                 IDManager.SetID(deliveryPeriodsIDRef_, ob);
             }
             else if (deliveryPeriodsNode.Attributes["href"] != null)
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
             }
         }
         else
         {
             deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
         }
     }
     
 
     XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");
     
     if (deliveryConditionsNode != null)
     {
         if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null) 
         {
             if (deliveryConditionsNode.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                 MetalDelivery ob = new MetalDelivery(deliveryConditionsNode);
                 IDManager.SetID(deliveryConditionsIDRef_, ob);
             }
             else if (deliveryConditionsNode.Attributes["href"] != null)
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
             }
         }
         else
         {
             deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
         }
     }
     
 
     XmlNode physicalQuantityNode = xmlNode.SelectSingleNode("physicalQuantity");
     
     if (physicalQuantityNode != null)
     {
         if (physicalQuantityNode.Attributes["href"] != null || physicalQuantityNode.Attributes["id"] != null) 
         {
             if (physicalQuantityNode.Attributes["id"] != null) 
             {
                 physicalQuantityIDRef_ = physicalQuantityNode.Attributes["id"].Value;
                 CommodityNotionalQuantity ob = new CommodityNotionalQuantity(physicalQuantityNode);
                 IDManager.SetID(physicalQuantityIDRef_, ob);
             }
             else if (physicalQuantityNode.Attributes["href"] != null)
             {
                 physicalQuantityIDRef_ = physicalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
             }
         }
         else
         {
             physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
         }
     }
     
 
     XmlNode physicalQuantityScheduleNode = xmlNode.SelectSingleNode("physicalQuantitySchedule");
     
     if (physicalQuantityScheduleNode != null)
     {
         if (physicalQuantityScheduleNode.Attributes["href"] != null || physicalQuantityScheduleNode.Attributes["id"] != null) 
         {
             if (physicalQuantityScheduleNode.Attributes["id"] != null) 
             {
                 physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["id"].Value;
                 CommodityPhysicalQuantitySchedule ob = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                 IDManager.SetID(physicalQuantityScheduleIDRef_, ob);
             }
             else if (physicalQuantityScheduleNode.Attributes["href"] != null)
             {
                 physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
             }
         }
         else
         {
             physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
         }
     }
     
 
     XmlNode totalPhysicalQuantityNode = xmlNode.SelectSingleNode("totalPhysicalQuantity");
     
     if (totalPhysicalQuantityNode != null)
     {
         if (totalPhysicalQuantityNode.Attributes["href"] != null || totalPhysicalQuantityNode.Attributes["id"] != null) 
         {
             if (totalPhysicalQuantityNode.Attributes["id"] != null) 
             {
                 totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["id"].Value;
                 UnitQuantity ob = new UnitQuantity(totalPhysicalQuantityNode);
                 IDManager.SetID(totalPhysicalQuantityIDRef_, ob);
             }
             else if (totalPhysicalQuantityNode.Attributes["href"] != null)
             {
                 totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
             }
         }
         else
         {
             totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
         }
     }
     
 
     XmlNode conversionFactorNode = xmlNode.SelectSingleNode("conversionFactor");
     
     if (conversionFactorNode != null)
     {
         if (conversionFactorNode.Attributes["href"] != null || conversionFactorNode.Attributes["id"] != null) 
         {
             if (conversionFactorNode.Attributes["id"] != null) 
             {
                 conversionFactorIDRef_ = conversionFactorNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(conversionFactorNode);
                 IDManager.SetID(conversionFactorIDRef_, ob);
             }
             else if (conversionFactorNode.Attributes["href"] != null)
             {
                 conversionFactorIDRef_ = conversionFactorNode.Attributes["href"].Value;
             }
             else
             {
                 conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
             }
         }
         else
         {
             conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
         }
     }
     
 
 }
 public ElectricityPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");
     if (deliveryPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef = item.Attributes["id"].Name;
                 CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                 IDManager.SetID(deliveryPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriods = new CommodityDeliveryPeriods(item);
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");
     
     foreach (XmlNode item in settlementPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsIDRef = item.Attributes["id"].Name;
                 List<SettlementPeriods> ob = new List<SettlementPeriods>();
                 ob.Add(new SettlementPeriods(item));
                 IDManager.SetID(settlementPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriods.Add(new SettlementPeriods(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsSchedule");
     if (settlementPeriodsScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementPeriodsScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsScheduleIDRef = item.Attributes["id"].Name;
                 SettlementPeriodsSchedule ob = SettlementPeriodsSchedule();
                 IDManager.SetID(settlementPeriodsScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementPeriodsSchedule = new SettlementPeriodsSchedule(item);
             }
         }
     }
     
 
     XmlNodeList loadTypeNodeList = xmlNode.SelectNodes("loadType");
     if (loadTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in loadTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 loadTypeIDRef = item.Attributes["id"].Name;
                 LoadTypeEnum ob = LoadTypeEnum();
                 IDManager.SetID(loadTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 loadTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 loadType = new LoadTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList electricityNodeList = xmlNode.SelectNodes("electricity");
     if (electricityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in electricityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 electricityIDRef = item.Attributes["id"].Name;
                 ElectricityProduct ob = ElectricityProduct();
                 IDManager.SetID(electricityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 electricityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 electricity = new ElectricityProduct(item);
             }
         }
     }
     
 
     XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");
     if (deliveryConditionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryConditionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef = item.Attributes["id"].Name;
                 ElectricityDelivery ob = ElectricityDelivery();
                 IDManager.SetID(deliveryConditionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryConditionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryConditions = new ElectricityDelivery(item);
             }
         }
     }
     
 
     XmlNodeList deliveryQuantityNodeList = xmlNode.SelectNodes("deliveryQuantity");
     if (deliveryQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryQuantityIDRef = item.Attributes["id"].Name;
                 ElectricityPhysicalQuantity ob = ElectricityPhysicalQuantity();
                 IDManager.SetID(deliveryQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryQuantity = new ElectricityPhysicalQuantity(item);
             }
         }
     }
     
 
 }
 public ElectricityPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");
     
     if (deliveryPeriodsNode != null)
     {
         if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                 CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                 IDManager.SetID(deliveryPeriodsIDRef_, ob);
             }
             else if (deliveryPeriodsNode.Attributes["href"] != null)
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
             }
         }
         else
         {
             deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
         }
     }
     
 
     XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");
     
     if (settlementPeriodsNodeList != null)
     {
         this.settlementPeriods_ = new List<SettlementPeriods>();
         foreach (XmlNode item in settlementPeriodsNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsIDRef_ = item.Attributes["id"].Value;
                     settlementPeriods_.Add(new SettlementPeriods(item));
                     IDManager.SetID(settlementPeriodsIDRef_, settlementPeriods_[settlementPeriods_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriods_.Add(new SettlementPeriods(item));
                 }
             }
             else
             {
                 settlementPeriods_.Add(new SettlementPeriods(item));
             }
         }
     }
     
 
     XmlNode settlementPeriodsScheduleNode = xmlNode.SelectSingleNode("settlementPeriodsSchedule");
     
     if (settlementPeriodsScheduleNode != null)
     {
         if (settlementPeriodsScheduleNode.Attributes["href"] != null || settlementPeriodsScheduleNode.Attributes["id"] != null) 
         {
             if (settlementPeriodsScheduleNode.Attributes["id"] != null) 
             {
                 settlementPeriodsScheduleIDRef_ = settlementPeriodsScheduleNode.Attributes["id"].Value;
                 SettlementPeriodsSchedule ob = new SettlementPeriodsSchedule(settlementPeriodsScheduleNode);
                 IDManager.SetID(settlementPeriodsScheduleIDRef_, ob);
             }
             else if (settlementPeriodsScheduleNode.Attributes["href"] != null)
             {
                 settlementPeriodsScheduleIDRef_ = settlementPeriodsScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 settlementPeriodsSchedule_ = new SettlementPeriodsSchedule(settlementPeriodsScheduleNode);
             }
         }
         else
         {
             settlementPeriodsSchedule_ = new SettlementPeriodsSchedule(settlementPeriodsScheduleNode);
         }
     }
     
 
     XmlNode loadTypeNode = xmlNode.SelectSingleNode("loadType");
     
     if (loadTypeNode != null)
     {
         if (loadTypeNode.Attributes["href"] != null || loadTypeNode.Attributes["id"] != null) 
         {
             if (loadTypeNode.Attributes["id"] != null) 
             {
                 loadTypeIDRef_ = loadTypeNode.Attributes["id"].Value;
                 LoadTypeEnum ob = new LoadTypeEnum(loadTypeNode);
                 IDManager.SetID(loadTypeIDRef_, ob);
             }
             else if (loadTypeNode.Attributes["href"] != null)
             {
                 loadTypeIDRef_ = loadTypeNode.Attributes["href"].Value;
             }
             else
             {
                 loadType_ = new LoadTypeEnum(loadTypeNode);
             }
         }
         else
         {
             loadType_ = new LoadTypeEnum(loadTypeNode);
         }
     }
     
 
     XmlNode electricityNode = xmlNode.SelectSingleNode("electricity");
     
     if (electricityNode != null)
     {
         if (electricityNode.Attributes["href"] != null || electricityNode.Attributes["id"] != null) 
         {
             if (electricityNode.Attributes["id"] != null) 
             {
                 electricityIDRef_ = electricityNode.Attributes["id"].Value;
                 ElectricityProduct ob = new ElectricityProduct(electricityNode);
                 IDManager.SetID(electricityIDRef_, ob);
             }
             else if (electricityNode.Attributes["href"] != null)
             {
                 electricityIDRef_ = electricityNode.Attributes["href"].Value;
             }
             else
             {
                 electricity_ = new ElectricityProduct(electricityNode);
             }
         }
         else
         {
             electricity_ = new ElectricityProduct(electricityNode);
         }
     }
     
 
     XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");
     
     if (deliveryConditionsNode != null)
     {
         if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null) 
         {
             if (deliveryConditionsNode.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                 ElectricityDelivery ob = new ElectricityDelivery(deliveryConditionsNode);
                 IDManager.SetID(deliveryConditionsIDRef_, ob);
             }
             else if (deliveryConditionsNode.Attributes["href"] != null)
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryConditions_ = new ElectricityDelivery(deliveryConditionsNode);
             }
         }
         else
         {
             deliveryConditions_ = new ElectricityDelivery(deliveryConditionsNode);
         }
     }
     
 
     XmlNode deliveryQuantityNode = xmlNode.SelectSingleNode("deliveryQuantity");
     
     if (deliveryQuantityNode != null)
     {
         if (deliveryQuantityNode.Attributes["href"] != null || deliveryQuantityNode.Attributes["id"] != null) 
         {
             if (deliveryQuantityNode.Attributes["id"] != null) 
             {
                 deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["id"].Value;
                 ElectricityPhysicalQuantity ob = new ElectricityPhysicalQuantity(deliveryQuantityNode);
                 IDManager.SetID(deliveryQuantityIDRef_, ob);
             }
             else if (deliveryQuantityNode.Attributes["href"] != null)
             {
                 deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryQuantity_ = new ElectricityPhysicalQuantity(deliveryQuantityNode);
             }
         }
         else
         {
             deliveryQuantity_ = new ElectricityPhysicalQuantity(deliveryQuantityNode);
         }
     }
     
 
 }
 public CoalPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");
     if (deliveryPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef = item.Attributes["id"].Name;
                 CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                 IDManager.SetID(deliveryPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriods = new CommodityDeliveryPeriods(item);
             }
         }
     }
     
 
     XmlNodeList coalNodeList = xmlNode.SelectNodes("coal");
     if (coalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in coalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 coalIDRef = item.Attributes["id"].Name;
                 CoalProduct ob = CoalProduct();
                 IDManager.SetID(coalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 coalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 coal = new CoalProduct(item);
             }
         }
     }
     
 
     XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");
     if (deliveryConditionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryConditionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef = item.Attributes["id"].Name;
                 CoalDelivery ob = CoalDelivery();
                 IDManager.SetID(deliveryConditionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryConditionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryConditions = new CoalDelivery(item);
             }
         }
     }
     
 
     XmlNodeList deliveryQuantityNodeList = xmlNode.SelectNodes("deliveryQuantity");
     if (deliveryQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryQuantityIDRef = item.Attributes["id"].Name;
                 CommodityPhysicalQuantity ob = CommodityPhysicalQuantity();
                 IDManager.SetID(deliveryQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryQuantity = new CommodityPhysicalQuantity(item);
             }
         }
     }
     
 
 }
 public MetalPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList metalNodeList = xmlNode.SelectNodes("metal");
     if (metalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in metalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 metalIDRef = item.Attributes["id"].Name;
                 Metal ob = Metal();
                 IDManager.SetID(metalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 metalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 metal = new Metal(item);
             }
         }
     }
     
 
     XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");
     if (deliveryPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef = item.Attributes["id"].Name;
                 CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                 IDManager.SetID(deliveryPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriods = new CommodityDeliveryPeriods(item);
             }
         }
     }
     
 
     XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");
     if (deliveryConditionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryConditionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef = item.Attributes["id"].Name;
                 MetalDelivery ob = MetalDelivery();
                 IDManager.SetID(deliveryConditionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryConditionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryConditions = new MetalDelivery(item);
             }
         }
     }
     
 
     XmlNodeList physicalQuantityNodeList = xmlNode.SelectNodes("physicalQuantity");
     if (physicalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalQuantityIDRef = item.Attributes["id"].Name;
                 CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                 IDManager.SetID(physicalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalQuantity = new CommodityNotionalQuantity(item);
             }
         }
     }
     
 
     XmlNodeList physicalQuantityScheduleNodeList = xmlNode.SelectNodes("physicalQuantitySchedule");
     if (physicalQuantityScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalQuantityScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalQuantityScheduleIDRef = item.Attributes["id"].Name;
                 CommodityPhysicalQuantitySchedule ob = CommodityPhysicalQuantitySchedule();
                 IDManager.SetID(physicalQuantityScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalQuantityScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalQuantitySchedule = new CommodityPhysicalQuantitySchedule(item);
             }
         }
     }
     
 
     XmlNodeList totalPhysicalQuantityNodeList = xmlNode.SelectNodes("totalPhysicalQuantity");
     if (totalPhysicalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in totalPhysicalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 totalPhysicalQuantityIDRef = item.Attributes["id"].Name;
                 UnitQuantity ob = UnitQuantity();
                 IDManager.SetID(totalPhysicalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 totalPhysicalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 totalPhysicalQuantity = new UnitQuantity(item);
             }
         }
     }
     
 
     XmlNodeList conversionFactorNodeList = xmlNode.SelectNodes("conversionFactor");
     if (conversionFactorNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in conversionFactorNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 conversionFactorIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(conversionFactorIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 conversionFactorIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 conversionFactor = new XsdTypeDecimal(item);
             }
         }
     }
     
 
 }
Exemple #10
0
        public ElectricityPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");

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

            foreach (XmlNode item in deliveryPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef = item.Attributes["id"].Name;
                        CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                        IDManager.SetID(deliveryPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryPeriods = new CommodityDeliveryPeriods(item);
                    }
                }
            }


            XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");

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


            XmlNodeList settlementPeriodsScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsSchedule");

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

            foreach (XmlNode item in settlementPeriodsScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementPeriodsScheduleIDRef = item.Attributes["id"].Name;
                        SettlementPeriodsSchedule ob = SettlementPeriodsSchedule();
                        IDManager.SetID(settlementPeriodsScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementPeriodsScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementPeriodsSchedule = new SettlementPeriodsSchedule(item);
                    }
                }
            }


            XmlNodeList loadTypeNodeList = xmlNode.SelectNodes("loadType");

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

            foreach (XmlNode item in loadTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        loadTypeIDRef = item.Attributes["id"].Name;
                        LoadTypeEnum ob = LoadTypeEnum();
                        IDManager.SetID(loadTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        loadTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        loadType = new LoadTypeEnum(item);
                    }
                }
            }


            XmlNodeList electricityNodeList = xmlNode.SelectNodes("electricity");

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

            foreach (XmlNode item in electricityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        electricityIDRef = item.Attributes["id"].Name;
                        ElectricityProduct ob = ElectricityProduct();
                        IDManager.SetID(electricityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        electricityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        electricity = new ElectricityProduct(item);
                    }
                }
            }


            XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");

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

            foreach (XmlNode item in deliveryConditionsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef = item.Attributes["id"].Name;
                        ElectricityDelivery ob = ElectricityDelivery();
                        IDManager.SetID(deliveryConditionsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryConditionsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryConditions = new ElectricityDelivery(item);
                    }
                }
            }


            XmlNodeList deliveryQuantityNodeList = xmlNode.SelectNodes("deliveryQuantity");

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

            foreach (XmlNode item in deliveryQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryQuantityIDRef = item.Attributes["id"].Name;
                        ElectricityPhysicalQuantity ob = ElectricityPhysicalQuantity();
                        IDManager.SetID(deliveryQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryQuantity = new ElectricityPhysicalQuantity(item);
                    }
                }
            }
        }
 public CoalPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");
     
     if (deliveryPeriodsNode != null)
     {
         if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                 CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                 IDManager.SetID(deliveryPeriodsIDRef_, ob);
             }
             else if (deliveryPeriodsNode.Attributes["href"] != null)
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
             }
         }
         else
         {
             deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
         }
     }
     
 
     XmlNode coalNode = xmlNode.SelectSingleNode("coal");
     
     if (coalNode != null)
     {
         if (coalNode.Attributes["href"] != null || coalNode.Attributes["id"] != null) 
         {
             if (coalNode.Attributes["id"] != null) 
             {
                 coalIDRef_ = coalNode.Attributes["id"].Value;
                 CoalProduct ob = new CoalProduct(coalNode);
                 IDManager.SetID(coalIDRef_, ob);
             }
             else if (coalNode.Attributes["href"] != null)
             {
                 coalIDRef_ = coalNode.Attributes["href"].Value;
             }
             else
             {
                 coal_ = new CoalProduct(coalNode);
             }
         }
         else
         {
             coal_ = new CoalProduct(coalNode);
         }
     }
     
 
     XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");
     
     if (deliveryConditionsNode != null)
     {
         if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null) 
         {
             if (deliveryConditionsNode.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                 CoalDelivery ob = new CoalDelivery(deliveryConditionsNode);
                 IDManager.SetID(deliveryConditionsIDRef_, ob);
             }
             else if (deliveryConditionsNode.Attributes["href"] != null)
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryConditions_ = new CoalDelivery(deliveryConditionsNode);
             }
         }
         else
         {
             deliveryConditions_ = new CoalDelivery(deliveryConditionsNode);
         }
     }
     
 
     XmlNode deliveryQuantityNode = xmlNode.SelectSingleNode("deliveryQuantity");
     
     if (deliveryQuantityNode != null)
     {
         if (deliveryQuantityNode.Attributes["href"] != null || deliveryQuantityNode.Attributes["id"] != null) 
         {
             if (deliveryQuantityNode.Attributes["id"] != null) 
             {
                 deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["id"].Value;
                 CommodityPhysicalQuantity ob = new CommodityPhysicalQuantity(deliveryQuantityNode);
                 IDManager.SetID(deliveryQuantityIDRef_, ob);
             }
             else if (deliveryQuantityNode.Attributes["href"] != null)
             {
                 deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryQuantity_ = new CommodityPhysicalQuantity(deliveryQuantityNode);
             }
         }
         else
         {
             deliveryQuantity_ = new CommodityPhysicalQuantity(deliveryQuantityNode);
         }
     }
     
 
 }
        public MetalPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode metalNode = xmlNode.SelectSingleNode("metal");

            if (metalNode != null)
            {
                if (metalNode.Attributes["href"] != null || metalNode.Attributes["id"] != null)
                {
                    if (metalNode.Attributes["id"] != null)
                    {
                        metalIDRef_ = metalNode.Attributes["id"].Value;
                        Metal ob = new Metal(metalNode);
                        IDManager.SetID(metalIDRef_, ob);
                    }
                    else if (metalNode.Attributes["href"] != null)
                    {
                        metalIDRef_ = metalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        metal_ = new Metal(metalNode);
                    }
                }
                else
                {
                    metal_ = new Metal(metalNode);
                }
            }


            XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");

            if (deliveryPeriodsNode != null)
            {
                if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                        CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                        IDManager.SetID(deliveryPeriodsIDRef_, ob);
                    }
                    else if (deliveryPeriodsNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                    }
                }
                else
                {
                    deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                }
            }


            XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");

            if (deliveryConditionsNode != null)
            {
                if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null)
                {
                    if (deliveryConditionsNode.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                        MetalDelivery ob = new MetalDelivery(deliveryConditionsNode);
                        IDManager.SetID(deliveryConditionsIDRef_, ob);
                    }
                    else if (deliveryConditionsNode.Attributes["href"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
                    }
                }
                else
                {
                    deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
                }
            }


            XmlNode physicalQuantityNode = xmlNode.SelectSingleNode("physicalQuantity");

            if (physicalQuantityNode != null)
            {
                if (physicalQuantityNode.Attributes["href"] != null || physicalQuantityNode.Attributes["id"] != null)
                {
                    if (physicalQuantityNode.Attributes["id"] != null)
                    {
                        physicalQuantityIDRef_ = physicalQuantityNode.Attributes["id"].Value;
                        CommodityNotionalQuantity ob = new CommodityNotionalQuantity(physicalQuantityNode);
                        IDManager.SetID(physicalQuantityIDRef_, ob);
                    }
                    else if (physicalQuantityNode.Attributes["href"] != null)
                    {
                        physicalQuantityIDRef_ = physicalQuantityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
                    }
                }
                else
                {
                    physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
                }
            }


            XmlNode physicalQuantityScheduleNode = xmlNode.SelectSingleNode("physicalQuantitySchedule");

            if (physicalQuantityScheduleNode != null)
            {
                if (physicalQuantityScheduleNode.Attributes["href"] != null || physicalQuantityScheduleNode.Attributes["id"] != null)
                {
                    if (physicalQuantityScheduleNode.Attributes["id"] != null)
                    {
                        physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["id"].Value;
                        CommodityPhysicalQuantitySchedule ob = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                        IDManager.SetID(physicalQuantityScheduleIDRef_, ob);
                    }
                    else if (physicalQuantityScheduleNode.Attributes["href"] != null)
                    {
                        physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                    }
                }
                else
                {
                    physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                }
            }


            XmlNode totalPhysicalQuantityNode = xmlNode.SelectSingleNode("totalPhysicalQuantity");

            if (totalPhysicalQuantityNode != null)
            {
                if (totalPhysicalQuantityNode.Attributes["href"] != null || totalPhysicalQuantityNode.Attributes["id"] != null)
                {
                    if (totalPhysicalQuantityNode.Attributes["id"] != null)
                    {
                        totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["id"].Value;
                        UnitQuantity ob = new UnitQuantity(totalPhysicalQuantityNode);
                        IDManager.SetID(totalPhysicalQuantityIDRef_, ob);
                    }
                    else if (totalPhysicalQuantityNode.Attributes["href"] != null)
                    {
                        totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
                    }
                }
                else
                {
                    totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
                }
            }


            XmlNode conversionFactorNode = xmlNode.SelectSingleNode("conversionFactor");

            if (conversionFactorNode != null)
            {
                if (conversionFactorNode.Attributes["href"] != null || conversionFactorNode.Attributes["id"] != null)
                {
                    if (conversionFactorNode.Attributes["id"] != null)
                    {
                        conversionFactorIDRef_ = conversionFactorNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(conversionFactorNode);
                        IDManager.SetID(conversionFactorIDRef_, ob);
                    }
                    else if (conversionFactorNode.Attributes["href"] != null)
                    {
                        conversionFactorIDRef_ = conversionFactorNode.Attributes["href"].Value;
                    }
                    else
                    {
                        conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
                    }
                }
                else
                {
                    conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
                }
            }
        }