コード例 #1
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);
                    }
                }
            }
        }
コード例 #2
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);
         }
     }
     
 
 }
コード例 #3
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);
             }
         }
     }
     
 
 }
コード例 #4
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);
                }
            }
        }