Exemplo n.º 1
0
        public EuropeanExercise(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList expirationDateNodeList = xmlNode.SelectNodes("expirationDate");

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

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


            XmlNodeList relevantUnderlyingDateNodeList = xmlNode.SelectNodes("relevantUnderlyingDate");

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

            foreach (XmlNode item in relevantUnderlyingDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        relevantUnderlyingDateIDRef = item.Attributes["id"].Name;
                        AdjustableOrRelativeDates ob = AdjustableOrRelativeDates();
                        IDManager.SetID(relevantUnderlyingDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        relevantUnderlyingDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        relevantUnderlyingDate = new AdjustableOrRelativeDates(item);
                    }
                }
            }


            XmlNodeList earliestExerciseTimeNodeList = xmlNode.SelectNodes("earliestExerciseTime");

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

            foreach (XmlNode item in earliestExerciseTimeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        earliestExerciseTimeIDRef = item.Attributes["id"].Name;
                        BusinessCenterTime ob = BusinessCenterTime();
                        IDManager.SetID(earliestExerciseTimeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        earliestExerciseTimeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        earliestExerciseTime = new BusinessCenterTime(item);
                    }
                }
            }


            XmlNodeList expirationTimeNodeList = xmlNode.SelectNodes("expirationTime");

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

            foreach (XmlNode item in expirationTimeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        expirationTimeIDRef = item.Attributes["id"].Name;
                        BusinessCenterTime ob = BusinessCenterTime();
                        IDManager.SetID(expirationTimeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        expirationTimeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        expirationTime = new BusinessCenterTime(item);
                    }
                }
            }


            XmlNodeList partialExerciseNodeList = xmlNode.SelectNodes("partialExercise");

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

            foreach (XmlNode item in partialExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        partialExerciseIDRef = item.Attributes["id"].Name;
                        PartialExercise ob = PartialExercise();
                        IDManager.SetID(partialExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        partialExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        partialExercise = new PartialExercise(item);
                    }
                }
            }


            XmlNodeList exerciseFeeNodeList = xmlNode.SelectNodes("exerciseFee");

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

            foreach (XmlNode item in exerciseFeeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseFeeIDRef = item.Attributes["id"].Name;
                        ExerciseFee ob = ExerciseFee();
                        IDManager.SetID(exerciseFeeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseFeeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseFee = new ExerciseFee(item);
                    }
                }
            }
        }
 public EuropeanExercise(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList expirationDateNodeList = xmlNode.SelectNodes("expirationDate");
     if (expirationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in expirationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 expirationDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(expirationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 expirationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 expirationDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
     XmlNodeList relevantUnderlyingDateNodeList = xmlNode.SelectNodes("relevantUnderlyingDate");
     if (relevantUnderlyingDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in relevantUnderlyingDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 relevantUnderlyingDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDates ob = AdjustableOrRelativeDates();
                 IDManager.SetID(relevantUnderlyingDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 relevantUnderlyingDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 relevantUnderlyingDate = new AdjustableOrRelativeDates(item);
             }
         }
     }
     
 
     XmlNodeList earliestExerciseTimeNodeList = xmlNode.SelectNodes("earliestExerciseTime");
     if (earliestExerciseTimeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in earliestExerciseTimeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 earliestExerciseTimeIDRef = item.Attributes["id"].Name;
                 BusinessCenterTime ob = BusinessCenterTime();
                 IDManager.SetID(earliestExerciseTimeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 earliestExerciseTimeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 earliestExerciseTime = new BusinessCenterTime(item);
             }
         }
     }
     
 
     XmlNodeList expirationTimeNodeList = xmlNode.SelectNodes("expirationTime");
     if (expirationTimeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in expirationTimeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 expirationTimeIDRef = item.Attributes["id"].Name;
                 BusinessCenterTime ob = BusinessCenterTime();
                 IDManager.SetID(expirationTimeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 expirationTimeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 expirationTime = new BusinessCenterTime(item);
             }
         }
     }
     
 
     XmlNodeList partialExerciseNodeList = xmlNode.SelectNodes("partialExercise");
     if (partialExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in partialExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partialExerciseIDRef = item.Attributes["id"].Name;
                 PartialExercise ob = PartialExercise();
                 IDManager.SetID(partialExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partialExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 partialExercise = new PartialExercise(item);
             }
         }
     }
     
 
     XmlNodeList exerciseFeeNodeList = xmlNode.SelectNodes("exerciseFee");
     if (exerciseFeeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseFeeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseFeeIDRef = item.Attributes["id"].Name;
                 ExerciseFee ob = ExerciseFee();
                 IDManager.SetID(exerciseFeeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseFeeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseFee = new ExerciseFee(item);
             }
         }
     }
     
 
 }
        public EuropeanExercise(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode expirationDateNode = xmlNode.SelectSingleNode("expirationDate");

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


            XmlNode relevantUnderlyingDateNode = xmlNode.SelectSingleNode("relevantUnderlyingDate");

            if (relevantUnderlyingDateNode != null)
            {
                if (relevantUnderlyingDateNode.Attributes["href"] != null || relevantUnderlyingDateNode.Attributes["id"] != null)
                {
                    if (relevantUnderlyingDateNode.Attributes["id"] != null)
                    {
                        relevantUnderlyingDateIDRef_ = relevantUnderlyingDateNode.Attributes["id"].Value;
                        AdjustableOrRelativeDates ob = new AdjustableOrRelativeDates(relevantUnderlyingDateNode);
                        IDManager.SetID(relevantUnderlyingDateIDRef_, ob);
                    }
                    else if (relevantUnderlyingDateNode.Attributes["href"] != null)
                    {
                        relevantUnderlyingDateIDRef_ = relevantUnderlyingDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        relevantUnderlyingDate_ = new AdjustableOrRelativeDates(relevantUnderlyingDateNode);
                    }
                }
                else
                {
                    relevantUnderlyingDate_ = new AdjustableOrRelativeDates(relevantUnderlyingDateNode);
                }
            }


            XmlNode earliestExerciseTimeNode = xmlNode.SelectSingleNode("earliestExerciseTime");

            if (earliestExerciseTimeNode != null)
            {
                if (earliestExerciseTimeNode.Attributes["href"] != null || earliestExerciseTimeNode.Attributes["id"] != null)
                {
                    if (earliestExerciseTimeNode.Attributes["id"] != null)
                    {
                        earliestExerciseTimeIDRef_ = earliestExerciseTimeNode.Attributes["id"].Value;
                        BusinessCenterTime ob = new BusinessCenterTime(earliestExerciseTimeNode);
                        IDManager.SetID(earliestExerciseTimeIDRef_, ob);
                    }
                    else if (earliestExerciseTimeNode.Attributes["href"] != null)
                    {
                        earliestExerciseTimeIDRef_ = earliestExerciseTimeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        earliestExerciseTime_ = new BusinessCenterTime(earliestExerciseTimeNode);
                    }
                }
                else
                {
                    earliestExerciseTime_ = new BusinessCenterTime(earliestExerciseTimeNode);
                }
            }


            XmlNode expirationTimeNode = xmlNode.SelectSingleNode("expirationTime");

            if (expirationTimeNode != null)
            {
                if (expirationTimeNode.Attributes["href"] != null || expirationTimeNode.Attributes["id"] != null)
                {
                    if (expirationTimeNode.Attributes["id"] != null)
                    {
                        expirationTimeIDRef_ = expirationTimeNode.Attributes["id"].Value;
                        BusinessCenterTime ob = new BusinessCenterTime(expirationTimeNode);
                        IDManager.SetID(expirationTimeIDRef_, ob);
                    }
                    else if (expirationTimeNode.Attributes["href"] != null)
                    {
                        expirationTimeIDRef_ = expirationTimeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        expirationTime_ = new BusinessCenterTime(expirationTimeNode);
                    }
                }
                else
                {
                    expirationTime_ = new BusinessCenterTime(expirationTimeNode);
                }
            }


            XmlNode partialExerciseNode = xmlNode.SelectSingleNode("partialExercise");

            if (partialExerciseNode != null)
            {
                if (partialExerciseNode.Attributes["href"] != null || partialExerciseNode.Attributes["id"] != null)
                {
                    if (partialExerciseNode.Attributes["id"] != null)
                    {
                        partialExerciseIDRef_ = partialExerciseNode.Attributes["id"].Value;
                        PartialExercise ob = new PartialExercise(partialExerciseNode);
                        IDManager.SetID(partialExerciseIDRef_, ob);
                    }
                    else if (partialExerciseNode.Attributes["href"] != null)
                    {
                        partialExerciseIDRef_ = partialExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        partialExercise_ = new PartialExercise(partialExerciseNode);
                    }
                }
                else
                {
                    partialExercise_ = new PartialExercise(partialExerciseNode);
                }
            }


            XmlNode exerciseFeeNode = xmlNode.SelectSingleNode("exerciseFee");

            if (exerciseFeeNode != null)
            {
                if (exerciseFeeNode.Attributes["href"] != null || exerciseFeeNode.Attributes["id"] != null)
                {
                    if (exerciseFeeNode.Attributes["id"] != null)
                    {
                        exerciseFeeIDRef_ = exerciseFeeNode.Attributes["id"].Value;
                        ExerciseFee ob = new ExerciseFee(exerciseFeeNode);
                        IDManager.SetID(exerciseFeeIDRef_, ob);
                    }
                    else if (exerciseFeeNode.Attributes["href"] != null)
                    {
                        exerciseFeeIDRef_ = exerciseFeeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseFee_ = new ExerciseFee(exerciseFeeNode);
                    }
                }
                else
                {
                    exerciseFee_ = new ExerciseFee(exerciseFeeNode);
                }
            }
        }