コード例 #1
0
        public FxSingleLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode exchangedCurrency1Node = xmlNode.SelectSingleNode("exchangedCurrency1");

            if (exchangedCurrency1Node != null)
            {
                if (exchangedCurrency1Node.Attributes["href"] != null || exchangedCurrency1Node.Attributes["id"] != null)
                {
                    if (exchangedCurrency1Node.Attributes["id"] != null)
                    {
                        exchangedCurrency1IDRef_ = exchangedCurrency1Node.Attributes["id"].Value;
                        Payment ob = new Payment(exchangedCurrency1Node);
                        IDManager.SetID(exchangedCurrency1IDRef_, ob);
                    }
                    else if (exchangedCurrency1Node.Attributes["href"] != null)
                    {
                        exchangedCurrency1IDRef_ = exchangedCurrency1Node.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangedCurrency1_ = new Payment(exchangedCurrency1Node);
                    }
                }
                else
                {
                    exchangedCurrency1_ = new Payment(exchangedCurrency1Node);
                }
            }


            XmlNode exchangedCurrency2Node = xmlNode.SelectSingleNode("exchangedCurrency2");

            if (exchangedCurrency2Node != null)
            {
                if (exchangedCurrency2Node.Attributes["href"] != null || exchangedCurrency2Node.Attributes["id"] != null)
                {
                    if (exchangedCurrency2Node.Attributes["id"] != null)
                    {
                        exchangedCurrency2IDRef_ = exchangedCurrency2Node.Attributes["id"].Value;
                        Payment ob = new Payment(exchangedCurrency2Node);
                        IDManager.SetID(exchangedCurrency2IDRef_, ob);
                    }
                    else if (exchangedCurrency2Node.Attributes["href"] != null)
                    {
                        exchangedCurrency2IDRef_ = exchangedCurrency2Node.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangedCurrency2_ = new Payment(exchangedCurrency2Node);
                    }
                }
                else
                {
                    exchangedCurrency2_ = new Payment(exchangedCurrency2Node);
                }
            }


            XmlNode dealtCurrencyNode = xmlNode.SelectSingleNode("dealtCurrency");

            if (dealtCurrencyNode != null)
            {
                if (dealtCurrencyNode.Attributes["href"] != null || dealtCurrencyNode.Attributes["id"] != null)
                {
                    if (dealtCurrencyNode.Attributes["id"] != null)
                    {
                        dealtCurrencyIDRef_ = dealtCurrencyNode.Attributes["id"].Value;
                        DealtCurrencyEnum ob = new DealtCurrencyEnum(dealtCurrencyNode);
                        IDManager.SetID(dealtCurrencyIDRef_, ob);
                    }
                    else if (dealtCurrencyNode.Attributes["href"] != null)
                    {
                        dealtCurrencyIDRef_ = dealtCurrencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dealtCurrency_ = new DealtCurrencyEnum(dealtCurrencyNode);
                    }
                }
                else
                {
                    dealtCurrency_ = new DealtCurrencyEnum(dealtCurrencyNode);
                }
            }


            XmlNode tenorNameNode = xmlNode.SelectSingleNode("tenorName");

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


            XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");

            if (tenorPeriodNode != null)
            {
                if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null)
                {
                    if (tenorPeriodNode.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                        Period ob = new Period(tenorPeriodNode);
                        IDManager.SetID(tenorPeriodIDRef_, ob);
                    }
                    else if (tenorPeriodNode.Attributes["href"] != null)
                    {
                        tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        tenorPeriod_ = new Period(tenorPeriodNode);
                    }
                }
                else
                {
                    tenorPeriod_ = new Period(tenorPeriodNode);
                }
            }


            XmlNode valueDateNode = xmlNode.SelectSingleNode("valueDate");

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


            XmlNode currency1ValueDateNode = xmlNode.SelectSingleNode("currency1ValueDate");

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


            XmlNode currency2ValueDateNode = xmlNode.SelectSingleNode("currency2ValueDate");

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


            XmlNode exchangeRateNode = xmlNode.SelectSingleNode("exchangeRate");

            if (exchangeRateNode != null)
            {
                if (exchangeRateNode.Attributes["href"] != null || exchangeRateNode.Attributes["id"] != null)
                {
                    if (exchangeRateNode.Attributes["id"] != null)
                    {
                        exchangeRateIDRef_ = exchangeRateNode.Attributes["id"].Value;
                        ExchangeRate ob = new ExchangeRate(exchangeRateNode);
                        IDManager.SetID(exchangeRateIDRef_, ob);
                    }
                    else if (exchangeRateNode.Attributes["href"] != null)
                    {
                        exchangeRateIDRef_ = exchangeRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangeRate_ = new ExchangeRate(exchangeRateNode);
                    }
                }
                else
                {
                    exchangeRate_ = new ExchangeRate(exchangeRateNode);
                }
            }


            XmlNode nonDeliverableSettlementNode = xmlNode.SelectSingleNode("nonDeliverableSettlement");

            if (nonDeliverableSettlementNode != null)
            {
                if (nonDeliverableSettlementNode.Attributes["href"] != null || nonDeliverableSettlementNode.Attributes["id"] != null)
                {
                    if (nonDeliverableSettlementNode.Attributes["id"] != null)
                    {
                        nonDeliverableSettlementIDRef_ = nonDeliverableSettlementNode.Attributes["id"].Value;
                        FxCashSettlement ob = new FxCashSettlement(nonDeliverableSettlementNode);
                        IDManager.SetID(nonDeliverableSettlementIDRef_, ob);
                    }
                    else if (nonDeliverableSettlementNode.Attributes["href"] != null)
                    {
                        nonDeliverableSettlementIDRef_ = nonDeliverableSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        nonDeliverableSettlement_ = new FxCashSettlement(nonDeliverableSettlementNode);
                    }
                }
                else
                {
                    nonDeliverableSettlement_ = new FxCashSettlement(nonDeliverableSettlementNode);
                }
            }
        }
コード例 #2
0
        public FxOption(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");

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

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


            XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");

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

            foreach (XmlNode item in tenorPeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(tenorPeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        tenorPeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tenorPeriod = new Period(item);
                    }
                }
            }


            XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");

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

            foreach (XmlNode item in americanExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        americanExerciseIDRef = item.Attributes["id"].Name;
                        FxAmericanExercise ob = FxAmericanExercise();
                        IDManager.SetID(americanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        americanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        americanExercise = new FxAmericanExercise(item);
                    }
                }
            }


            XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");

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

            foreach (XmlNode item in europeanExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        europeanExerciseIDRef = item.Attributes["id"].Name;
                        FxEuropeanExercise ob = FxEuropeanExercise();
                        IDManager.SetID(europeanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        europeanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        europeanExercise = new FxEuropeanExercise(item);
                    }
                }
            }


            XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure");

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

            foreach (XmlNode item in exerciseProcedureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseProcedureIDRef = item.Attributes["id"].Name;
                        ExerciseProcedure ob = ExerciseProcedure();
                        IDManager.SetID(exerciseProcedureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseProcedureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseProcedure = new ExerciseProcedure(item);
                    }
                }
            }


            XmlNodeList putCurrencyAmountNodeList = xmlNode.SelectNodes("putCurrencyAmount");

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

            foreach (XmlNode item in putCurrencyAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        putCurrencyAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(putCurrencyAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        putCurrencyAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        putCurrencyAmount = new NonNegativeMoney(item);
                    }
                }
            }


            XmlNodeList callCurrencyAmountNodeList = xmlNode.SelectNodes("callCurrencyAmount");

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

            foreach (XmlNode item in callCurrencyAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        callCurrencyAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(callCurrencyAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        callCurrencyAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        callCurrencyAmount = new NonNegativeMoney(item);
                    }
                }
            }


            XmlNodeList soldAsNodeList = xmlNode.SelectNodes("soldAs");

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

            foreach (XmlNode item in soldAsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        soldAsIDRef = item.Attributes["id"].Name;
                        PutCallEnum ob = PutCallEnum();
                        IDManager.SetID(soldAsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        soldAsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        soldAs = new PutCallEnum(item);
                    }
                }
            }


            XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike");

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

            foreach (XmlNode item in strikeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        strikeIDRef = item.Attributes["id"].Name;
                        FxStrikePrice ob = FxStrikePrice();
                        IDManager.SetID(strikeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        strikeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        strike = new FxStrikePrice(item);
                    }
                }
            }


            XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate");

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

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


            XmlNodeList featuresNodeList = xmlNode.SelectNodes("features");

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

            foreach (XmlNode item in featuresNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        featuresIDRef = item.Attributes["id"].Name;
                        FxOptionFeatures ob = FxOptionFeatures();
                        IDManager.SetID(featuresIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        featuresIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        features = new FxOptionFeatures(item);
                    }
                }
            }


            XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");

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


            XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");

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

            foreach (XmlNode item in cashSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashSettlementIDRef = item.Attributes["id"].Name;
                        FxCashSettlement ob = FxCashSettlement();
                        IDManager.SetID(cashSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashSettlement = new FxCashSettlement(item);
                    }
                }
            }
        }
コード例 #3
0
 public FxSingleLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList exchangedCurrency1NodeList = xmlNode.SelectNodes("exchangedCurrency1");
     if (exchangedCurrency1NodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangedCurrency1NodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangedCurrency1IDRef = item.Attributes["id"].Name;
                 Payment ob = Payment();
                 IDManager.SetID(exchangedCurrency1IDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangedCurrency1IDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangedCurrency1 = new Payment(item);
             }
         }
     }
     
 
     XmlNodeList exchangedCurrency2NodeList = xmlNode.SelectNodes("exchangedCurrency2");
     if (exchangedCurrency2NodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangedCurrency2NodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangedCurrency2IDRef = item.Attributes["id"].Name;
                 Payment ob = Payment();
                 IDManager.SetID(exchangedCurrency2IDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangedCurrency2IDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangedCurrency2 = new Payment(item);
             }
         }
     }
     
 
     XmlNodeList dealtCurrencyNodeList = xmlNode.SelectNodes("dealtCurrency");
     if (dealtCurrencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dealtCurrencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dealtCurrencyIDRef = item.Attributes["id"].Name;
                 DealtCurrencyEnum ob = DealtCurrencyEnum();
                 IDManager.SetID(dealtCurrencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dealtCurrencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dealtCurrency = new DealtCurrencyEnum(item);
             }
         }
     }
     
 
     XmlNodeList tenorNameNodeList = xmlNode.SelectNodes("tenorName");
     if (tenorNameNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tenorNameNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tenorNameIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(tenorNameIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tenorNameIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 tenorName = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");
     if (tenorPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tenorPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(tenorPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tenorPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 tenorPeriod = new Period(item);
             }
         }
     }
     
 
     XmlNodeList valueDateNodeList = xmlNode.SelectNodes("valueDate");
     if (valueDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in valueDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 valueDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(valueDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 valueDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 valueDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList currency1ValueDateNodeList = xmlNode.SelectNodes("currency1ValueDate");
     if (currency1ValueDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currency1ValueDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currency1ValueDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(currency1ValueDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currency1ValueDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency1ValueDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList currency2ValueDateNodeList = xmlNode.SelectNodes("currency2ValueDate");
     if (currency2ValueDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currency2ValueDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currency2ValueDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(currency2ValueDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currency2ValueDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency2ValueDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList exchangeRateNodeList = xmlNode.SelectNodes("exchangeRate");
     if (exchangeRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeRateIDRef = item.Attributes["id"].Name;
                 ExchangeRate ob = ExchangeRate();
                 IDManager.SetID(exchangeRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeRate = new ExchangeRate(item);
             }
         }
     }
     
 
     XmlNodeList nonDeliverableSettlementNodeList = xmlNode.SelectNodes("nonDeliverableSettlement");
     if (nonDeliverableSettlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in nonDeliverableSettlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 nonDeliverableSettlementIDRef = item.Attributes["id"].Name;
                 FxCashSettlement ob = FxCashSettlement();
                 IDManager.SetID(nonDeliverableSettlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 nonDeliverableSettlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 nonDeliverableSettlement = new FxCashSettlement(item);
             }
         }
     }
     
 
 }
コード例 #4
0
 public FxOption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");
     if (effectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in effectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 effectiveDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(effectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 effectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 effectiveDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
     XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");
     if (tenorPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tenorPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(tenorPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tenorPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 tenorPeriod = new Period(item);
             }
         }
     }
     
 
     XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");
     if (americanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in americanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 americanExerciseIDRef = item.Attributes["id"].Name;
                 FxAmericanExercise ob = FxAmericanExercise();
                 IDManager.SetID(americanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 americanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 americanExercise = new FxAmericanExercise(item);
             }
         }
     }
     
 
     XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");
     if (europeanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in europeanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef = item.Attributes["id"].Name;
                 FxEuropeanExercise ob = FxEuropeanExercise();
                 IDManager.SetID(europeanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 europeanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 europeanExercise = new FxEuropeanExercise(item);
             }
         }
     }
     
 
     XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure");
     if (exerciseProcedureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseProcedureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseProcedureIDRef = item.Attributes["id"].Name;
                 ExerciseProcedure ob = ExerciseProcedure();
                 IDManager.SetID(exerciseProcedureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseProcedureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseProcedure = new ExerciseProcedure(item);
             }
         }
     }
     
 
     XmlNodeList putCurrencyAmountNodeList = xmlNode.SelectNodes("putCurrencyAmount");
     if (putCurrencyAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in putCurrencyAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 putCurrencyAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(putCurrencyAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 putCurrencyAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 putCurrencyAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList callCurrencyAmountNodeList = xmlNode.SelectNodes("callCurrencyAmount");
     if (callCurrencyAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in callCurrencyAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 callCurrencyAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(callCurrencyAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 callCurrencyAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 callCurrencyAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList soldAsNodeList = xmlNode.SelectNodes("soldAs");
     if (soldAsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in soldAsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 soldAsIDRef = item.Attributes["id"].Name;
                 PutCallEnum ob = PutCallEnum();
                 IDManager.SetID(soldAsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 soldAsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 soldAs = new PutCallEnum(item);
             }
         }
     }
     
 
     XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike");
     if (strikeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in strikeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strikeIDRef = item.Attributes["id"].Name;
                 FxStrikePrice ob = FxStrikePrice();
                 IDManager.SetID(strikeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strikeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 strike = new FxStrikePrice(item);
             }
         }
     }
     
 
     XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate");
     if (spotRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in spotRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 spotRateIDRef = item.Attributes["id"].Name;
                 PositiveDecimal ob = PositiveDecimal();
                 IDManager.SetID(spotRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 spotRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 spotRate = new PositiveDecimal(item);
             }
         }
     }
     
 
     XmlNodeList featuresNodeList = xmlNode.SelectNodes("features");
     if (featuresNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in featuresNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 featuresIDRef = item.Attributes["id"].Name;
                 FxOptionFeatures ob = FxOptionFeatures();
                 IDManager.SetID(featuresIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 featuresIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 features = new FxOptionFeatures(item);
             }
         }
     }
     
 
     XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");
     
     foreach (XmlNode item in premiumNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 premiumIDRef = item.Attributes["id"].Name;
                 List<FxOptionPremium> ob = new List<FxOptionPremium>();
                 ob.Add(new FxOptionPremium(item));
                 IDManager.SetID(premiumIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 premiumIDRef = item.Attributes["href"].Name;
             }
             else
             {
             premium.Add(new FxOptionPremium(item));
             }
         }
     }
     
 
     XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");
     if (cashSettlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cashSettlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cashSettlementIDRef = item.Attributes["id"].Name;
                 FxCashSettlement ob = FxCashSettlement();
                 IDManager.SetID(cashSettlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cashSettlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cashSettlement = new FxCashSettlement(item);
             }
         }
     }
     
 
 }
コード例 #5
0
        public FxSingleLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList exchangedCurrency1NodeList = xmlNode.SelectNodes("exchangedCurrency1");

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

            foreach (XmlNode item in exchangedCurrency1NodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangedCurrency1IDRef = item.Attributes["id"].Name;
                        Payment ob = Payment();
                        IDManager.SetID(exchangedCurrency1IDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangedCurrency1IDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangedCurrency1 = new Payment(item);
                    }
                }
            }


            XmlNodeList exchangedCurrency2NodeList = xmlNode.SelectNodes("exchangedCurrency2");

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

            foreach (XmlNode item in exchangedCurrency2NodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangedCurrency2IDRef = item.Attributes["id"].Name;
                        Payment ob = Payment();
                        IDManager.SetID(exchangedCurrency2IDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangedCurrency2IDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangedCurrency2 = new Payment(item);
                    }
                }
            }


            XmlNodeList dealtCurrencyNodeList = xmlNode.SelectNodes("dealtCurrency");

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

            foreach (XmlNode item in dealtCurrencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dealtCurrencyIDRef = item.Attributes["id"].Name;
                        DealtCurrencyEnum ob = DealtCurrencyEnum();
                        IDManager.SetID(dealtCurrencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dealtCurrencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dealtCurrency = new DealtCurrencyEnum(item);
                    }
                }
            }


            XmlNodeList tenorNameNodeList = xmlNode.SelectNodes("tenorName");

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

            foreach (XmlNode item in tenorNameNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        tenorNameIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(tenorNameIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        tenorNameIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tenorName = new XsdTypeBoolean(item);
                    }
                }
            }


            XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");

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

            foreach (XmlNode item in tenorPeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(tenorPeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        tenorPeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tenorPeriod = new Period(item);
                    }
                }
            }


            XmlNodeList valueDateNodeList = xmlNode.SelectNodes("valueDate");

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

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


            XmlNodeList currency1ValueDateNodeList = xmlNode.SelectNodes("currency1ValueDate");

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

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


            XmlNodeList currency2ValueDateNodeList = xmlNode.SelectNodes("currency2ValueDate");

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

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


            XmlNodeList exchangeRateNodeList = xmlNode.SelectNodes("exchangeRate");

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

            foreach (XmlNode item in exchangeRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangeRateIDRef = item.Attributes["id"].Name;
                        ExchangeRate ob = ExchangeRate();
                        IDManager.SetID(exchangeRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangeRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangeRate = new ExchangeRate(item);
                    }
                }
            }


            XmlNodeList nonDeliverableSettlementNodeList = xmlNode.SelectNodes("nonDeliverableSettlement");

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

            foreach (XmlNode item in nonDeliverableSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        nonDeliverableSettlementIDRef = item.Attributes["id"].Name;
                        FxCashSettlement ob = FxCashSettlement();
                        IDManager.SetID(nonDeliverableSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        nonDeliverableSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        nonDeliverableSettlement = new FxCashSettlement(item);
                    }
                }
            }
        }
コード例 #6
0
 public FxOption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");
     
     if (effectiveDateNode != null)
     {
         if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) 
         {
             if (effectiveDateNode.Attributes["id"] != null) 
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(effectiveDateNode);
                 IDManager.SetID(effectiveDateIDRef_, ob);
             }
             else if (effectiveDateNode.Attributes["href"] != null)
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
             }
         }
         else
         {
             effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
         }
     }
     
 
     XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");
     
     if (tenorPeriodNode != null)
     {
         if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null) 
         {
             if (tenorPeriodNode.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                 Period ob = new Period(tenorPeriodNode);
                 IDManager.SetID(tenorPeriodIDRef_, ob);
             }
             else if (tenorPeriodNode.Attributes["href"] != null)
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
             }
             else
             {
                 tenorPeriod_ = new Period(tenorPeriodNode);
             }
         }
         else
         {
             tenorPeriod_ = new Period(tenorPeriodNode);
         }
     }
     
 
     XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");
     
     if (americanExerciseNode != null)
     {
         if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) 
         {
             if (americanExerciseNode.Attributes["id"] != null) 
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                 FxAmericanExercise ob = new FxAmericanExercise(americanExerciseNode);
                 IDManager.SetID(americanExerciseIDRef_, ob);
             }
             else if (americanExerciseNode.Attributes["href"] != null)
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 americanExercise_ = new FxAmericanExercise(americanExerciseNode);
             }
         }
         else
         {
             americanExercise_ = new FxAmericanExercise(americanExerciseNode);
         }
     }
     
 
     XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");
     
     if (europeanExerciseNode != null)
     {
         if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) 
         {
             if (europeanExerciseNode.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                 FxEuropeanExercise ob = new FxEuropeanExercise(europeanExerciseNode);
                 IDManager.SetID(europeanExerciseIDRef_, ob);
             }
             else if (europeanExerciseNode.Attributes["href"] != null)
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 europeanExercise_ = new FxEuropeanExercise(europeanExerciseNode);
             }
         }
         else
         {
             europeanExercise_ = new FxEuropeanExercise(europeanExerciseNode);
         }
     }
     
 
     XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure");
     
     if (exerciseProcedureNode != null)
     {
         if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null) 
         {
             if (exerciseProcedureNode.Attributes["id"] != null) 
             {
                 exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value;
                 ExerciseProcedure ob = new ExerciseProcedure(exerciseProcedureNode);
                 IDManager.SetID(exerciseProcedureIDRef_, ob);
             }
             else if (exerciseProcedureNode.Attributes["href"] != null)
             {
                 exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode);
             }
         }
         else
         {
             exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode);
         }
     }
     
 
     XmlNode putCurrencyAmountNode = xmlNode.SelectSingleNode("putCurrencyAmount");
     
     if (putCurrencyAmountNode != null)
     {
         if (putCurrencyAmountNode.Attributes["href"] != null || putCurrencyAmountNode.Attributes["id"] != null) 
         {
             if (putCurrencyAmountNode.Attributes["id"] != null) 
             {
                 putCurrencyAmountIDRef_ = putCurrencyAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(putCurrencyAmountNode);
                 IDManager.SetID(putCurrencyAmountIDRef_, ob);
             }
             else if (putCurrencyAmountNode.Attributes["href"] != null)
             {
                 putCurrencyAmountIDRef_ = putCurrencyAmountNode.Attributes["href"].Value;
             }
             else
             {
                 putCurrencyAmount_ = new NonNegativeMoney(putCurrencyAmountNode);
             }
         }
         else
         {
             putCurrencyAmount_ = new NonNegativeMoney(putCurrencyAmountNode);
         }
     }
     
 
     XmlNode callCurrencyAmountNode = xmlNode.SelectSingleNode("callCurrencyAmount");
     
     if (callCurrencyAmountNode != null)
     {
         if (callCurrencyAmountNode.Attributes["href"] != null || callCurrencyAmountNode.Attributes["id"] != null) 
         {
             if (callCurrencyAmountNode.Attributes["id"] != null) 
             {
                 callCurrencyAmountIDRef_ = callCurrencyAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(callCurrencyAmountNode);
                 IDManager.SetID(callCurrencyAmountIDRef_, ob);
             }
             else if (callCurrencyAmountNode.Attributes["href"] != null)
             {
                 callCurrencyAmountIDRef_ = callCurrencyAmountNode.Attributes["href"].Value;
             }
             else
             {
                 callCurrencyAmount_ = new NonNegativeMoney(callCurrencyAmountNode);
             }
         }
         else
         {
             callCurrencyAmount_ = new NonNegativeMoney(callCurrencyAmountNode);
         }
     }
     
 
     XmlNode soldAsNode = xmlNode.SelectSingleNode("soldAs");
     
     if (soldAsNode != null)
     {
         if (soldAsNode.Attributes["href"] != null || soldAsNode.Attributes["id"] != null) 
         {
             if (soldAsNode.Attributes["id"] != null) 
             {
                 soldAsIDRef_ = soldAsNode.Attributes["id"].Value;
                 PutCallEnum ob = new PutCallEnum(soldAsNode);
                 IDManager.SetID(soldAsIDRef_, ob);
             }
             else if (soldAsNode.Attributes["href"] != null)
             {
                 soldAsIDRef_ = soldAsNode.Attributes["href"].Value;
             }
             else
             {
                 soldAs_ = new PutCallEnum(soldAsNode);
             }
         }
         else
         {
             soldAs_ = new PutCallEnum(soldAsNode);
         }
     }
     
 
     XmlNode strikeNode = xmlNode.SelectSingleNode("strike");
     
     if (strikeNode != null)
     {
         if (strikeNode.Attributes["href"] != null || strikeNode.Attributes["id"] != null) 
         {
             if (strikeNode.Attributes["id"] != null) 
             {
                 strikeIDRef_ = strikeNode.Attributes["id"].Value;
                 FxStrikePrice ob = new FxStrikePrice(strikeNode);
                 IDManager.SetID(strikeIDRef_, ob);
             }
             else if (strikeNode.Attributes["href"] != null)
             {
                 strikeIDRef_ = strikeNode.Attributes["href"].Value;
             }
             else
             {
                 strike_ = new FxStrikePrice(strikeNode);
             }
         }
         else
         {
             strike_ = new FxStrikePrice(strikeNode);
         }
     }
     
 
     XmlNode spotRateNode = xmlNode.SelectSingleNode("spotRate");
     
     if (spotRateNode != null)
     {
         if (spotRateNode.Attributes["href"] != null || spotRateNode.Attributes["id"] != null) 
         {
             if (spotRateNode.Attributes["id"] != null) 
             {
                 spotRateIDRef_ = spotRateNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(spotRateNode);
                 IDManager.SetID(spotRateIDRef_, ob);
             }
             else if (spotRateNode.Attributes["href"] != null)
             {
                 spotRateIDRef_ = spotRateNode.Attributes["href"].Value;
             }
             else
             {
                 spotRate_ = new PositiveDecimal(spotRateNode);
             }
         }
         else
         {
             spotRate_ = new PositiveDecimal(spotRateNode);
         }
     }
     
 
     XmlNode featuresNode = xmlNode.SelectSingleNode("features");
     
     if (featuresNode != null)
     {
         if (featuresNode.Attributes["href"] != null || featuresNode.Attributes["id"] != null) 
         {
             if (featuresNode.Attributes["id"] != null) 
             {
                 featuresIDRef_ = featuresNode.Attributes["id"].Value;
                 FxOptionFeatures ob = new FxOptionFeatures(featuresNode);
                 IDManager.SetID(featuresIDRef_, ob);
             }
             else if (featuresNode.Attributes["href"] != null)
             {
                 featuresIDRef_ = featuresNode.Attributes["href"].Value;
             }
             else
             {
                 features_ = new FxOptionFeatures(featuresNode);
             }
         }
         else
         {
             features_ = new FxOptionFeatures(featuresNode);
         }
     }
     
 
     XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");
     
     if (premiumNodeList != null)
     {
         this.premium_ = new List<FxOptionPremium>();
         foreach (XmlNode item in premiumNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     premiumIDRef_ = item.Attributes["id"].Value;
                     premium_.Add(new FxOptionPremium(item));
                     IDManager.SetID(premiumIDRef_, premium_[premium_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     premiumIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 premium_.Add(new FxOptionPremium(item));
                 }
             }
             else
             {
                 premium_.Add(new FxOptionPremium(item));
             }
         }
     }
     
 
     XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");
     
     if (cashSettlementNode != null)
     {
         if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) 
         {
             if (cashSettlementNode.Attributes["id"] != null) 
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                 FxCashSettlement ob = new FxCashSettlement(cashSettlementNode);
                 IDManager.SetID(cashSettlementIDRef_, ob);
             }
             else if (cashSettlementNode.Attributes["href"] != null)
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 cashSettlement_ = new FxCashSettlement(cashSettlementNode);
             }
         }
         else
         {
             cashSettlement_ = new FxCashSettlement(cashSettlementNode);
         }
     }
     
 
 }
コード例 #7
0
 public FxSwapLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode tradeIdentifierReferenceNode = xmlNode.SelectSingleNode("tradeIdentifierReference");
     
     if (tradeIdentifierReferenceNode != null)
     {
         if (tradeIdentifierReferenceNode.Attributes["href"] != null || tradeIdentifierReferenceNode.Attributes["id"] != null) 
         {
             if (tradeIdentifierReferenceNode.Attributes["id"] != null) 
             {
                 tradeIdentifierReferenceIDRef_ = tradeIdentifierReferenceNode.Attributes["id"].Value;
                 PartyTradeIdentifierReference ob = new PartyTradeIdentifierReference(tradeIdentifierReferenceNode);
                 IDManager.SetID(tradeIdentifierReferenceIDRef_, ob);
             }
             else if (tradeIdentifierReferenceNode.Attributes["href"] != null)
             {
                 tradeIdentifierReferenceIDRef_ = tradeIdentifierReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 tradeIdentifierReference_ = new PartyTradeIdentifierReference(tradeIdentifierReferenceNode);
             }
         }
         else
         {
             tradeIdentifierReference_ = new PartyTradeIdentifierReference(tradeIdentifierReferenceNode);
         }
     }
     
 
     XmlNode exchangedCurrency1Node = xmlNode.SelectSingleNode("exchangedCurrency1");
     
     if (exchangedCurrency1Node != null)
     {
         if (exchangedCurrency1Node.Attributes["href"] != null || exchangedCurrency1Node.Attributes["id"] != null) 
         {
             if (exchangedCurrency1Node.Attributes["id"] != null) 
             {
                 exchangedCurrency1IDRef_ = exchangedCurrency1Node.Attributes["id"].Value;
                 Payment ob = new Payment(exchangedCurrency1Node);
                 IDManager.SetID(exchangedCurrency1IDRef_, ob);
             }
             else if (exchangedCurrency1Node.Attributes["href"] != null)
             {
                 exchangedCurrency1IDRef_ = exchangedCurrency1Node.Attributes["href"].Value;
             }
             else
             {
                 exchangedCurrency1_ = new Payment(exchangedCurrency1Node);
             }
         }
         else
         {
             exchangedCurrency1_ = new Payment(exchangedCurrency1Node);
         }
     }
     
 
     XmlNode exchangedCurrency2Node = xmlNode.SelectSingleNode("exchangedCurrency2");
     
     if (exchangedCurrency2Node != null)
     {
         if (exchangedCurrency2Node.Attributes["href"] != null || exchangedCurrency2Node.Attributes["id"] != null) 
         {
             if (exchangedCurrency2Node.Attributes["id"] != null) 
             {
                 exchangedCurrency2IDRef_ = exchangedCurrency2Node.Attributes["id"].Value;
                 Payment ob = new Payment(exchangedCurrency2Node);
                 IDManager.SetID(exchangedCurrency2IDRef_, ob);
             }
             else if (exchangedCurrency2Node.Attributes["href"] != null)
             {
                 exchangedCurrency2IDRef_ = exchangedCurrency2Node.Attributes["href"].Value;
             }
             else
             {
                 exchangedCurrency2_ = new Payment(exchangedCurrency2Node);
             }
         }
         else
         {
             exchangedCurrency2_ = new Payment(exchangedCurrency2Node);
         }
     }
     
 
     XmlNode dealtCurrencyNode = xmlNode.SelectSingleNode("dealtCurrency");
     
     if (dealtCurrencyNode != null)
     {
         if (dealtCurrencyNode.Attributes["href"] != null || dealtCurrencyNode.Attributes["id"] != null) 
         {
             if (dealtCurrencyNode.Attributes["id"] != null) 
             {
                 dealtCurrencyIDRef_ = dealtCurrencyNode.Attributes["id"].Value;
                 DealtCurrencyEnum ob = new DealtCurrencyEnum(dealtCurrencyNode);
                 IDManager.SetID(dealtCurrencyIDRef_, ob);
             }
             else if (dealtCurrencyNode.Attributes["href"] != null)
             {
                 dealtCurrencyIDRef_ = dealtCurrencyNode.Attributes["href"].Value;
             }
             else
             {
                 dealtCurrency_ = new DealtCurrencyEnum(dealtCurrencyNode);
             }
         }
         else
         {
             dealtCurrency_ = new DealtCurrencyEnum(dealtCurrencyNode);
         }
     }
     
 
     XmlNode tenorNameNode = xmlNode.SelectSingleNode("tenorName");
     
     if (tenorNameNode != null)
     {
         if (tenorNameNode.Attributes["href"] != null || tenorNameNode.Attributes["id"] != null) 
         {
             if (tenorNameNode.Attributes["id"] != null) 
             {
                 tenorNameIDRef_ = tenorNameNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(tenorNameNode);
                 IDManager.SetID(tenorNameIDRef_, ob);
             }
             else if (tenorNameNode.Attributes["href"] != null)
             {
                 tenorNameIDRef_ = tenorNameNode.Attributes["href"].Value;
             }
             else
             {
                 tenorName_ = new XsdTypeBoolean(tenorNameNode);
             }
         }
         else
         {
             tenorName_ = new XsdTypeBoolean(tenorNameNode);
         }
     }
     
 
     XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");
     
     if (tenorPeriodNode != null)
     {
         if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null) 
         {
             if (tenorPeriodNode.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                 Period ob = new Period(tenorPeriodNode);
                 IDManager.SetID(tenorPeriodIDRef_, ob);
             }
             else if (tenorPeriodNode.Attributes["href"] != null)
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
             }
             else
             {
                 tenorPeriod_ = new Period(tenorPeriodNode);
             }
         }
         else
         {
             tenorPeriod_ = new Period(tenorPeriodNode);
         }
     }
     
 
     XmlNode valueDateNode = xmlNode.SelectSingleNode("valueDate");
     
     if (valueDateNode != null)
     {
         if (valueDateNode.Attributes["href"] != null || valueDateNode.Attributes["id"] != null) 
         {
             if (valueDateNode.Attributes["id"] != null) 
             {
                 valueDateIDRef_ = valueDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(valueDateNode);
                 IDManager.SetID(valueDateIDRef_, ob);
             }
             else if (valueDateNode.Attributes["href"] != null)
             {
                 valueDateIDRef_ = valueDateNode.Attributes["href"].Value;
             }
             else
             {
                 valueDate_ = new XsdTypeDate(valueDateNode);
             }
         }
         else
         {
             valueDate_ = new XsdTypeDate(valueDateNode);
         }
     }
     
 
     XmlNode currency1ValueDateNode = xmlNode.SelectSingleNode("currency1ValueDate");
     
     if (currency1ValueDateNode != null)
     {
         if (currency1ValueDateNode.Attributes["href"] != null || currency1ValueDateNode.Attributes["id"] != null) 
         {
             if (currency1ValueDateNode.Attributes["id"] != null) 
             {
                 currency1ValueDateIDRef_ = currency1ValueDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(currency1ValueDateNode);
                 IDManager.SetID(currency1ValueDateIDRef_, ob);
             }
             else if (currency1ValueDateNode.Attributes["href"] != null)
             {
                 currency1ValueDateIDRef_ = currency1ValueDateNode.Attributes["href"].Value;
             }
             else
             {
                 currency1ValueDate_ = new XsdTypeDate(currency1ValueDateNode);
             }
         }
         else
         {
             currency1ValueDate_ = new XsdTypeDate(currency1ValueDateNode);
         }
     }
     
 
     XmlNode currency2ValueDateNode = xmlNode.SelectSingleNode("currency2ValueDate");
     
     if (currency2ValueDateNode != null)
     {
         if (currency2ValueDateNode.Attributes["href"] != null || currency2ValueDateNode.Attributes["id"] != null) 
         {
             if (currency2ValueDateNode.Attributes["id"] != null) 
             {
                 currency2ValueDateIDRef_ = currency2ValueDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(currency2ValueDateNode);
                 IDManager.SetID(currency2ValueDateIDRef_, ob);
             }
             else if (currency2ValueDateNode.Attributes["href"] != null)
             {
                 currency2ValueDateIDRef_ = currency2ValueDateNode.Attributes["href"].Value;
             }
             else
             {
                 currency2ValueDate_ = new XsdTypeDate(currency2ValueDateNode);
             }
         }
         else
         {
             currency2ValueDate_ = new XsdTypeDate(currency2ValueDateNode);
         }
     }
     
 
     XmlNode exchangeRateNode = xmlNode.SelectSingleNode("exchangeRate");
     
     if (exchangeRateNode != null)
     {
         if (exchangeRateNode.Attributes["href"] != null || exchangeRateNode.Attributes["id"] != null) 
         {
             if (exchangeRateNode.Attributes["id"] != null) 
             {
                 exchangeRateIDRef_ = exchangeRateNode.Attributes["id"].Value;
                 ExchangeRate ob = new ExchangeRate(exchangeRateNode);
                 IDManager.SetID(exchangeRateIDRef_, ob);
             }
             else if (exchangeRateNode.Attributes["href"] != null)
             {
                 exchangeRateIDRef_ = exchangeRateNode.Attributes["href"].Value;
             }
             else
             {
                 exchangeRate_ = new ExchangeRate(exchangeRateNode);
             }
         }
         else
         {
             exchangeRate_ = new ExchangeRate(exchangeRateNode);
         }
     }
     
 
     XmlNode nonDeliverableSettlementNode = xmlNode.SelectSingleNode("nonDeliverableSettlement");
     
     if (nonDeliverableSettlementNode != null)
     {
         if (nonDeliverableSettlementNode.Attributes["href"] != null || nonDeliverableSettlementNode.Attributes["id"] != null) 
         {
             if (nonDeliverableSettlementNode.Attributes["id"] != null) 
             {
                 nonDeliverableSettlementIDRef_ = nonDeliverableSettlementNode.Attributes["id"].Value;
                 FxCashSettlement ob = new FxCashSettlement(nonDeliverableSettlementNode);
                 IDManager.SetID(nonDeliverableSettlementIDRef_, ob);
             }
             else if (nonDeliverableSettlementNode.Attributes["href"] != null)
             {
                 nonDeliverableSettlementIDRef_ = nonDeliverableSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 nonDeliverableSettlement_ = new FxCashSettlement(nonDeliverableSettlementNode);
             }
         }
         else
         {
             nonDeliverableSettlement_ = new FxCashSettlement(nonDeliverableSettlementNode);
         }
     }
     
 
 }
コード例 #8
0
        public FxOption(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");

            if (effectiveDateNode != null)
            {
                if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null)
                {
                    if (effectiveDateNode.Attributes["id"] != null)
                    {
                        effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                        AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(effectiveDateNode);
                        IDManager.SetID(effectiveDateIDRef_, ob);
                    }
                    else if (effectiveDateNode.Attributes["href"] != null)
                    {
                        effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
                    }
                }
                else
                {
                    effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
                }
            }


            XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");

            if (tenorPeriodNode != null)
            {
                if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null)
                {
                    if (tenorPeriodNode.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                        Period ob = new Period(tenorPeriodNode);
                        IDManager.SetID(tenorPeriodIDRef_, ob);
                    }
                    else if (tenorPeriodNode.Attributes["href"] != null)
                    {
                        tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        tenorPeriod_ = new Period(tenorPeriodNode);
                    }
                }
                else
                {
                    tenorPeriod_ = new Period(tenorPeriodNode);
                }
            }


            XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");

            if (americanExerciseNode != null)
            {
                if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null)
                {
                    if (americanExerciseNode.Attributes["id"] != null)
                    {
                        americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                        FxAmericanExercise ob = new FxAmericanExercise(americanExerciseNode);
                        IDManager.SetID(americanExerciseIDRef_, ob);
                    }
                    else if (americanExerciseNode.Attributes["href"] != null)
                    {
                        americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        americanExercise_ = new FxAmericanExercise(americanExerciseNode);
                    }
                }
                else
                {
                    americanExercise_ = new FxAmericanExercise(americanExerciseNode);
                }
            }


            XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");

            if (europeanExerciseNode != null)
            {
                if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null)
                {
                    if (europeanExerciseNode.Attributes["id"] != null)
                    {
                        europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                        FxEuropeanExercise ob = new FxEuropeanExercise(europeanExerciseNode);
                        IDManager.SetID(europeanExerciseIDRef_, ob);
                    }
                    else if (europeanExerciseNode.Attributes["href"] != null)
                    {
                        europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        europeanExercise_ = new FxEuropeanExercise(europeanExerciseNode);
                    }
                }
                else
                {
                    europeanExercise_ = new FxEuropeanExercise(europeanExerciseNode);
                }
            }


            XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure");

            if (exerciseProcedureNode != null)
            {
                if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null)
                {
                    if (exerciseProcedureNode.Attributes["id"] != null)
                    {
                        exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value;
                        ExerciseProcedure ob = new ExerciseProcedure(exerciseProcedureNode);
                        IDManager.SetID(exerciseProcedureIDRef_, ob);
                    }
                    else if (exerciseProcedureNode.Attributes["href"] != null)
                    {
                        exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode);
                    }
                }
                else
                {
                    exerciseProcedure_ = new ExerciseProcedure(exerciseProcedureNode);
                }
            }


            XmlNode putCurrencyAmountNode = xmlNode.SelectSingleNode("putCurrencyAmount");

            if (putCurrencyAmountNode != null)
            {
                if (putCurrencyAmountNode.Attributes["href"] != null || putCurrencyAmountNode.Attributes["id"] != null)
                {
                    if (putCurrencyAmountNode.Attributes["id"] != null)
                    {
                        putCurrencyAmountIDRef_ = putCurrencyAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(putCurrencyAmountNode);
                        IDManager.SetID(putCurrencyAmountIDRef_, ob);
                    }
                    else if (putCurrencyAmountNode.Attributes["href"] != null)
                    {
                        putCurrencyAmountIDRef_ = putCurrencyAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        putCurrencyAmount_ = new NonNegativeMoney(putCurrencyAmountNode);
                    }
                }
                else
                {
                    putCurrencyAmount_ = new NonNegativeMoney(putCurrencyAmountNode);
                }
            }


            XmlNode callCurrencyAmountNode = xmlNode.SelectSingleNode("callCurrencyAmount");

            if (callCurrencyAmountNode != null)
            {
                if (callCurrencyAmountNode.Attributes["href"] != null || callCurrencyAmountNode.Attributes["id"] != null)
                {
                    if (callCurrencyAmountNode.Attributes["id"] != null)
                    {
                        callCurrencyAmountIDRef_ = callCurrencyAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(callCurrencyAmountNode);
                        IDManager.SetID(callCurrencyAmountIDRef_, ob);
                    }
                    else if (callCurrencyAmountNode.Attributes["href"] != null)
                    {
                        callCurrencyAmountIDRef_ = callCurrencyAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        callCurrencyAmount_ = new NonNegativeMoney(callCurrencyAmountNode);
                    }
                }
                else
                {
                    callCurrencyAmount_ = new NonNegativeMoney(callCurrencyAmountNode);
                }
            }


            XmlNode soldAsNode = xmlNode.SelectSingleNode("soldAs");

            if (soldAsNode != null)
            {
                if (soldAsNode.Attributes["href"] != null || soldAsNode.Attributes["id"] != null)
                {
                    if (soldAsNode.Attributes["id"] != null)
                    {
                        soldAsIDRef_ = soldAsNode.Attributes["id"].Value;
                        PutCallEnum ob = new PutCallEnum(soldAsNode);
                        IDManager.SetID(soldAsIDRef_, ob);
                    }
                    else if (soldAsNode.Attributes["href"] != null)
                    {
                        soldAsIDRef_ = soldAsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        soldAs_ = new PutCallEnum(soldAsNode);
                    }
                }
                else
                {
                    soldAs_ = new PutCallEnum(soldAsNode);
                }
            }


            XmlNode strikeNode = xmlNode.SelectSingleNode("strike");

            if (strikeNode != null)
            {
                if (strikeNode.Attributes["href"] != null || strikeNode.Attributes["id"] != null)
                {
                    if (strikeNode.Attributes["id"] != null)
                    {
                        strikeIDRef_ = strikeNode.Attributes["id"].Value;
                        FxStrikePrice ob = new FxStrikePrice(strikeNode);
                        IDManager.SetID(strikeIDRef_, ob);
                    }
                    else if (strikeNode.Attributes["href"] != null)
                    {
                        strikeIDRef_ = strikeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        strike_ = new FxStrikePrice(strikeNode);
                    }
                }
                else
                {
                    strike_ = new FxStrikePrice(strikeNode);
                }
            }


            XmlNode spotRateNode = xmlNode.SelectSingleNode("spotRate");

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


            XmlNode featuresNode = xmlNode.SelectSingleNode("features");

            if (featuresNode != null)
            {
                if (featuresNode.Attributes["href"] != null || featuresNode.Attributes["id"] != null)
                {
                    if (featuresNode.Attributes["id"] != null)
                    {
                        featuresIDRef_ = featuresNode.Attributes["id"].Value;
                        FxOptionFeatures ob = new FxOptionFeatures(featuresNode);
                        IDManager.SetID(featuresIDRef_, ob);
                    }
                    else if (featuresNode.Attributes["href"] != null)
                    {
                        featuresIDRef_ = featuresNode.Attributes["href"].Value;
                    }
                    else
                    {
                        features_ = new FxOptionFeatures(featuresNode);
                    }
                }
                else
                {
                    features_ = new FxOptionFeatures(featuresNode);
                }
            }


            XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");

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


            XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");

            if (cashSettlementNode != null)
            {
                if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null)
                {
                    if (cashSettlementNode.Attributes["id"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                        FxCashSettlement ob = new FxCashSettlement(cashSettlementNode);
                        IDManager.SetID(cashSettlementIDRef_, ob);
                    }
                    else if (cashSettlementNode.Attributes["href"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashSettlement_ = new FxCashSettlement(cashSettlementNode);
                    }
                }
                else
                {
                    cashSettlement_ = new FxCashSettlement(cashSettlementNode);
                }
            }
        }