public BullionPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode bullionTypeNode = xmlNode.SelectSingleNode("bullionType");
     
     if (bullionTypeNode != null)
     {
         if (bullionTypeNode.Attributes["href"] != null || bullionTypeNode.Attributes["id"] != null) 
         {
             if (bullionTypeNode.Attributes["id"] != null) 
             {
                 bullionTypeIDRef_ = bullionTypeNode.Attributes["id"].Value;
                 BullionTypeEnum ob = new BullionTypeEnum(bullionTypeNode);
                 IDManager.SetID(bullionTypeIDRef_, ob);
             }
             else if (bullionTypeNode.Attributes["href"] != null)
             {
                 bullionTypeIDRef_ = bullionTypeNode.Attributes["href"].Value;
             }
             else
             {
                 bullionType_ = new BullionTypeEnum(bullionTypeNode);
             }
         }
         else
         {
             bullionType_ = new BullionTypeEnum(bullionTypeNode);
         }
     }
     
 
     XmlNode deliveryLocationNode = xmlNode.SelectSingleNode("deliveryLocation");
     
     if (deliveryLocationNode != null)
     {
         if (deliveryLocationNode.Attributes["href"] != null || deliveryLocationNode.Attributes["id"] != null) 
         {
             if (deliveryLocationNode.Attributes["id"] != null) 
             {
                 deliveryLocationIDRef_ = deliveryLocationNode.Attributes["id"].Value;
                 BullionDeliveryLocation ob = new BullionDeliveryLocation(deliveryLocationNode);
                 IDManager.SetID(deliveryLocationIDRef_, ob);
             }
             else if (deliveryLocationNode.Attributes["href"] != null)
             {
                 deliveryLocationIDRef_ = deliveryLocationNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryLocation_ = new BullionDeliveryLocation(deliveryLocationNode);
             }
         }
         else
         {
             deliveryLocation_ = new BullionDeliveryLocation(deliveryLocationNode);
         }
     }
     
 
     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 settlementDateNode = xmlNode.SelectSingleNode("settlementDate");
     
     if (settlementDateNode != null)
     {
         if (settlementDateNode.Attributes["href"] != null || settlementDateNode.Attributes["id"] != null) 
         {
             if (settlementDateNode.Attributes["id"] != null) 
             {
                 settlementDateIDRef_ = settlementDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(settlementDateNode);
                 IDManager.SetID(settlementDateIDRef_, ob);
             }
             else if (settlementDateNode.Attributes["href"] != null)
             {
                 settlementDateIDRef_ = settlementDateNode.Attributes["href"].Value;
             }
             else
             {
                 settlementDate_ = new AdjustableOrRelativeDate(settlementDateNode);
             }
         }
         else
         {
             settlementDate_ = new AdjustableOrRelativeDate(settlementDateNode);
         }
     }
     
 
 }
Пример #2
0
        public BullionPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode bullionTypeNode = xmlNode.SelectSingleNode("bullionType");

            if (bullionTypeNode != null)
            {
                if (bullionTypeNode.Attributes["href"] != null || bullionTypeNode.Attributes["id"] != null)
                {
                    if (bullionTypeNode.Attributes["id"] != null)
                    {
                        bullionTypeIDRef_ = bullionTypeNode.Attributes["id"].Value;
                        BullionTypeEnum ob = new BullionTypeEnum(bullionTypeNode);
                        IDManager.SetID(bullionTypeIDRef_, ob);
                    }
                    else if (bullionTypeNode.Attributes["href"] != null)
                    {
                        bullionTypeIDRef_ = bullionTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        bullionType_ = new BullionTypeEnum(bullionTypeNode);
                    }
                }
                else
                {
                    bullionType_ = new BullionTypeEnum(bullionTypeNode);
                }
            }


            XmlNode deliveryLocationNode = xmlNode.SelectSingleNode("deliveryLocation");

            if (deliveryLocationNode != null)
            {
                if (deliveryLocationNode.Attributes["href"] != null || deliveryLocationNode.Attributes["id"] != null)
                {
                    if (deliveryLocationNode.Attributes["id"] != null)
                    {
                        deliveryLocationIDRef_ = deliveryLocationNode.Attributes["id"].Value;
                        BullionDeliveryLocation ob = new BullionDeliveryLocation(deliveryLocationNode);
                        IDManager.SetID(deliveryLocationIDRef_, ob);
                    }
                    else if (deliveryLocationNode.Attributes["href"] != null)
                    {
                        deliveryLocationIDRef_ = deliveryLocationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryLocation_ = new BullionDeliveryLocation(deliveryLocationNode);
                    }
                }
                else
                {
                    deliveryLocation_ = new BullionDeliveryLocation(deliveryLocationNode);
                }
            }


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

            if (settlementDateNode != null)
            {
                if (settlementDateNode.Attributes["href"] != null || settlementDateNode.Attributes["id"] != null)
                {
                    if (settlementDateNode.Attributes["id"] != null)
                    {
                        settlementDateIDRef_ = settlementDateNode.Attributes["id"].Value;
                        AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(settlementDateNode);
                        IDManager.SetID(settlementDateIDRef_, ob);
                    }
                    else if (settlementDateNode.Attributes["href"] != null)
                    {
                        settlementDateIDRef_ = settlementDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementDate_ = new AdjustableOrRelativeDate(settlementDateNode);
                    }
                }
                else
                {
                    settlementDate_ = new AdjustableOrRelativeDate(settlementDateNode);
                }
            }
        }
Пример #3
0
        public BullionPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList bullionTypeNodeList = xmlNode.SelectNodes("bullionType");

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

            foreach (XmlNode item in bullionTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        bullionTypeIDRef = item.Attributes["id"].Name;
                        BullionTypeEnum ob = BullionTypeEnum();
                        IDManager.SetID(bullionTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        bullionTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        bullionType = new BullionTypeEnum(item);
                    }
                }
            }


            XmlNodeList deliveryLocationNodeList = xmlNode.SelectNodes("deliveryLocation");

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

            foreach (XmlNode item in deliveryLocationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryLocationIDRef = item.Attributes["id"].Name;
                        BullionDeliveryLocation ob = BullionDeliveryLocation();
                        IDManager.SetID(deliveryLocationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryLocationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryLocation = new BullionDeliveryLocation(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 settlementDateNodeList = xmlNode.SelectNodes("settlementDate");

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

            foreach (XmlNode item in settlementDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementDateIDRef = item.Attributes["id"].Name;
                        AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                        IDManager.SetID(settlementDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementDate = new AdjustableOrRelativeDate(item);
                    }
                }
            }
        }