public FxBarrierFeature(XmlNode xmlNode)
 {
     XmlNode barrierTypeNode = xmlNode.SelectSingleNode("barrierType");
     
     if (barrierTypeNode != null)
     {
         if (barrierTypeNode.Attributes["href"] != null || barrierTypeNode.Attributes["id"] != null) 
         {
             if (barrierTypeNode.Attributes["id"] != null) 
             {
                 barrierTypeIDRef_ = barrierTypeNode.Attributes["id"].Value;
                 FxBarrierTypeEnum ob = new FxBarrierTypeEnum(barrierTypeNode);
                 IDManager.SetID(barrierTypeIDRef_, ob);
             }
             else if (barrierTypeNode.Attributes["href"] != null)
             {
                 barrierTypeIDRef_ = barrierTypeNode.Attributes["href"].Value;
             }
             else
             {
                 barrierType_ = new FxBarrierTypeEnum(barrierTypeNode);
             }
         }
         else
         {
             barrierType_ = new FxBarrierTypeEnum(barrierTypeNode);
         }
     }
     
 
     XmlNode quotedCurrencyPairNode = xmlNode.SelectSingleNode("quotedCurrencyPair");
     
     if (quotedCurrencyPairNode != null)
     {
         if (quotedCurrencyPairNode.Attributes["href"] != null || quotedCurrencyPairNode.Attributes["id"] != null) 
         {
             if (quotedCurrencyPairNode.Attributes["id"] != null) 
             {
                 quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["id"].Value;
                 QuotedCurrencyPair ob = new QuotedCurrencyPair(quotedCurrencyPairNode);
                 IDManager.SetID(quotedCurrencyPairIDRef_, ob);
             }
             else if (quotedCurrencyPairNode.Attributes["href"] != null)
             {
                 quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["href"].Value;
             }
             else
             {
                 quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
             }
         }
         else
         {
             quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
         }
     }
     
 
     XmlNode triggerRateNode = xmlNode.SelectSingleNode("triggerRate");
     
     if (triggerRateNode != null)
     {
         if (triggerRateNode.Attributes["href"] != null || triggerRateNode.Attributes["id"] != null) 
         {
             if (triggerRateNode.Attributes["id"] != null) 
             {
                 triggerRateIDRef_ = triggerRateNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(triggerRateNode);
                 IDManager.SetID(triggerRateIDRef_, ob);
             }
             else if (triggerRateNode.Attributes["href"] != null)
             {
                 triggerRateIDRef_ = triggerRateNode.Attributes["href"].Value;
             }
             else
             {
                 triggerRate_ = new PositiveDecimal(triggerRateNode);
             }
         }
         else
         {
             triggerRate_ = new PositiveDecimal(triggerRateNode);
         }
     }
     
 
     XmlNodeList informationSourceNodeList = xmlNode.SelectNodes("informationSource");
     
     if (informationSourceNodeList != null)
     {
         this.informationSource_ = new List<InformationSource>();
         foreach (XmlNode item in informationSourceNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     informationSourceIDRef_ = item.Attributes["id"].Value;
                     informationSource_.Add(new InformationSource(item));
                     IDManager.SetID(informationSourceIDRef_, informationSource_[informationSource_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     informationSourceIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 informationSource_.Add(new InformationSource(item));
                 }
             }
             else
             {
                 informationSource_.Add(new InformationSource(item));
             }
         }
     }
     
 
     XmlNode observationStartDateNode = xmlNode.SelectSingleNode("observationStartDate");
     
     if (observationStartDateNode != null)
     {
         if (observationStartDateNode.Attributes["href"] != null || observationStartDateNode.Attributes["id"] != null) 
         {
             if (observationStartDateNode.Attributes["id"] != null) 
             {
                 observationStartDateIDRef_ = observationStartDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(observationStartDateNode);
                 IDManager.SetID(observationStartDateIDRef_, ob);
             }
             else if (observationStartDateNode.Attributes["href"] != null)
             {
                 observationStartDateIDRef_ = observationStartDateNode.Attributes["href"].Value;
             }
             else
             {
                 observationStartDate_ = new XsdTypeDate(observationStartDateNode);
             }
         }
         else
         {
             observationStartDate_ = new XsdTypeDate(observationStartDateNode);
         }
     }
     
 
     XmlNode observationEndDateNode = xmlNode.SelectSingleNode("observationEndDate");
     
     if (observationEndDateNode != null)
     {
         if (observationEndDateNode.Attributes["href"] != null || observationEndDateNode.Attributes["id"] != null) 
         {
             if (observationEndDateNode.Attributes["id"] != null) 
             {
                 observationEndDateIDRef_ = observationEndDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(observationEndDateNode);
                 IDManager.SetID(observationEndDateIDRef_, ob);
             }
             else if (observationEndDateNode.Attributes["href"] != null)
             {
                 observationEndDateIDRef_ = observationEndDateNode.Attributes["href"].Value;
             }
             else
             {
                 observationEndDate_ = new XsdTypeDate(observationEndDateNode);
             }
         }
         else
         {
             observationEndDate_ = new XsdTypeDate(observationEndDateNode);
         }
     }
     
 
 }
        public FxBarrierFeature(XmlNode xmlNode)
        {
            XmlNode barrierTypeNode = xmlNode.SelectSingleNode("barrierType");

            if (barrierTypeNode != null)
            {
                if (barrierTypeNode.Attributes["href"] != null || barrierTypeNode.Attributes["id"] != null)
                {
                    if (barrierTypeNode.Attributes["id"] != null)
                    {
                        barrierTypeIDRef_ = barrierTypeNode.Attributes["id"].Value;
                        FxBarrierTypeEnum ob = new FxBarrierTypeEnum(barrierTypeNode);
                        IDManager.SetID(barrierTypeIDRef_, ob);
                    }
                    else if (barrierTypeNode.Attributes["href"] != null)
                    {
                        barrierTypeIDRef_ = barrierTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        barrierType_ = new FxBarrierTypeEnum(barrierTypeNode);
                    }
                }
                else
                {
                    barrierType_ = new FxBarrierTypeEnum(barrierTypeNode);
                }
            }


            XmlNode quotedCurrencyPairNode = xmlNode.SelectSingleNode("quotedCurrencyPair");

            if (quotedCurrencyPairNode != null)
            {
                if (quotedCurrencyPairNode.Attributes["href"] != null || quotedCurrencyPairNode.Attributes["id"] != null)
                {
                    if (quotedCurrencyPairNode.Attributes["id"] != null)
                    {
                        quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["id"].Value;
                        QuotedCurrencyPair ob = new QuotedCurrencyPair(quotedCurrencyPairNode);
                        IDManager.SetID(quotedCurrencyPairIDRef_, ob);
                    }
                    else if (quotedCurrencyPairNode.Attributes["href"] != null)
                    {
                        quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["href"].Value;
                    }
                    else
                    {
                        quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
                    }
                }
                else
                {
                    quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
                }
            }


            XmlNode triggerRateNode = xmlNode.SelectSingleNode("triggerRate");

            if (triggerRateNode != null)
            {
                if (triggerRateNode.Attributes["href"] != null || triggerRateNode.Attributes["id"] != null)
                {
                    if (triggerRateNode.Attributes["id"] != null)
                    {
                        triggerRateIDRef_ = triggerRateNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(triggerRateNode);
                        IDManager.SetID(triggerRateIDRef_, ob);
                    }
                    else if (triggerRateNode.Attributes["href"] != null)
                    {
                        triggerRateIDRef_ = triggerRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        triggerRate_ = new PositiveDecimal(triggerRateNode);
                    }
                }
                else
                {
                    triggerRate_ = new PositiveDecimal(triggerRateNode);
                }
            }


            XmlNodeList informationSourceNodeList = xmlNode.SelectNodes("informationSource");

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


            XmlNode observationStartDateNode = xmlNode.SelectSingleNode("observationStartDate");

            if (observationStartDateNode != null)
            {
                if (observationStartDateNode.Attributes["href"] != null || observationStartDateNode.Attributes["id"] != null)
                {
                    if (observationStartDateNode.Attributes["id"] != null)
                    {
                        observationStartDateIDRef_ = observationStartDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(observationStartDateNode);
                        IDManager.SetID(observationStartDateIDRef_, ob);
                    }
                    else if (observationStartDateNode.Attributes["href"] != null)
                    {
                        observationStartDateIDRef_ = observationStartDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        observationStartDate_ = new XsdTypeDate(observationStartDateNode);
                    }
                }
                else
                {
                    observationStartDate_ = new XsdTypeDate(observationStartDateNode);
                }
            }


            XmlNode observationEndDateNode = xmlNode.SelectSingleNode("observationEndDate");

            if (observationEndDateNode != null)
            {
                if (observationEndDateNode.Attributes["href"] != null || observationEndDateNode.Attributes["id"] != null)
                {
                    if (observationEndDateNode.Attributes["id"] != null)
                    {
                        observationEndDateIDRef_ = observationEndDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(observationEndDateNode);
                        IDManager.SetID(observationEndDateIDRef_, ob);
                    }
                    else if (observationEndDateNode.Attributes["href"] != null)
                    {
                        observationEndDateIDRef_ = observationEndDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        observationEndDate_ = new XsdTypeDate(observationEndDateNode);
                    }
                }
                else
                {
                    observationEndDate_ = new XsdTypeDate(observationEndDateNode);
                }
            }
        }
Esempio n. 3
0
        public FxBarrierFeature(XmlNode xmlNode)
        {
            XmlNodeList barrierTypeNodeList = xmlNode.SelectNodes("barrierType");

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

            foreach (XmlNode item in barrierTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        barrierTypeIDRef = item.Attributes["id"].Name;
                        FxBarrierTypeEnum ob = FxBarrierTypeEnum();
                        IDManager.SetID(barrierTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        barrierTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        barrierType = new FxBarrierTypeEnum(item);
                    }
                }
            }


            XmlNodeList quotedCurrencyPairNodeList = xmlNode.SelectNodes("quotedCurrencyPair");

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

            foreach (XmlNode item in quotedCurrencyPairNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quotedCurrencyPairIDRef = item.Attributes["id"].Name;
                        QuotedCurrencyPair ob = QuotedCurrencyPair();
                        IDManager.SetID(quotedCurrencyPairIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quotedCurrencyPairIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quotedCurrencyPair = new QuotedCurrencyPair(item);
                    }
                }
            }


            XmlNodeList triggerRateNodeList = xmlNode.SelectNodes("triggerRate");

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

            foreach (XmlNode item in triggerRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        triggerRateIDRef = item.Attributes["id"].Name;
                        PositiveDecimal ob = PositiveDecimal();
                        IDManager.SetID(triggerRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        triggerRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        triggerRate = new PositiveDecimal(item);
                    }
                }
            }


            XmlNodeList informationSourceNodeList = xmlNode.SelectNodes("informationSource");

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


            XmlNodeList observationStartDateNodeList = xmlNode.SelectNodes("observationStartDate");

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

            foreach (XmlNode item in observationStartDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        observationStartDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(observationStartDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        observationStartDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        observationStartDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList observationEndDateNodeList = xmlNode.SelectNodes("observationEndDate");

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

            foreach (XmlNode item in observationEndDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        observationEndDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(observationEndDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        observationEndDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        observationEndDate = new XsdTypeDate(item);
                    }
                }
            }
        }