Example #1
0
        public QuotedCurrencyPair(XmlNode xmlNode)
        {
            XmlNodeList currency1NodeList = xmlNode.SelectNodes("currency1");

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

            foreach (XmlNode item in currency1NodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currency1IDRef = item.Attributes["id"].Name;
                        Currency ob = Currency();
                        IDManager.SetID(currency1IDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currency1IDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency1 = new Currency(item);
                    }
                }
            }


            XmlNodeList currency2NodeList = xmlNode.SelectNodes("currency2");

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

            foreach (XmlNode item in currency2NodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currency2IDRef = item.Attributes["id"].Name;
                        Currency ob = Currency();
                        IDManager.SetID(currency2IDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currency2IDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency2 = new Currency(item);
                    }
                }
            }


            XmlNodeList quoteBasisNodeList = xmlNode.SelectNodes("quoteBasis");

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

            foreach (XmlNode item in quoteBasisNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quoteBasisIDRef = item.Attributes["id"].Name;
                        QuoteBasisEnum ob = QuoteBasisEnum();
                        IDManager.SetID(quoteBasisIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quoteBasisIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quoteBasis = new QuoteBasisEnum(item);
                    }
                }
            }
        }
 public QuotedCurrencyPair(XmlNode xmlNode)
 {
     XmlNode currency1Node = xmlNode.SelectSingleNode("currency1");
     
     if (currency1Node != null)
     {
         if (currency1Node.Attributes["href"] != null || currency1Node.Attributes["id"] != null) 
         {
             if (currency1Node.Attributes["id"] != null) 
             {
                 currency1IDRef_ = currency1Node.Attributes["id"].Value;
                 Currency ob = new Currency(currency1Node);
                 IDManager.SetID(currency1IDRef_, ob);
             }
             else if (currency1Node.Attributes["href"] != null)
             {
                 currency1IDRef_ = currency1Node.Attributes["href"].Value;
             }
             else
             {
                 currency1_ = new Currency(currency1Node);
             }
         }
         else
         {
             currency1_ = new Currency(currency1Node);
         }
     }
     
 
     XmlNode currency2Node = xmlNode.SelectSingleNode("currency2");
     
     if (currency2Node != null)
     {
         if (currency2Node.Attributes["href"] != null || currency2Node.Attributes["id"] != null) 
         {
             if (currency2Node.Attributes["id"] != null) 
             {
                 currency2IDRef_ = currency2Node.Attributes["id"].Value;
                 Currency ob = new Currency(currency2Node);
                 IDManager.SetID(currency2IDRef_, ob);
             }
             else if (currency2Node.Attributes["href"] != null)
             {
                 currency2IDRef_ = currency2Node.Attributes["href"].Value;
             }
             else
             {
                 currency2_ = new Currency(currency2Node);
             }
         }
         else
         {
             currency2_ = new Currency(currency2Node);
         }
     }
     
 
     XmlNode quoteBasisNode = xmlNode.SelectSingleNode("quoteBasis");
     
     if (quoteBasisNode != null)
     {
         if (quoteBasisNode.Attributes["href"] != null || quoteBasisNode.Attributes["id"] != null) 
         {
             if (quoteBasisNode.Attributes["id"] != null) 
             {
                 quoteBasisIDRef_ = quoteBasisNode.Attributes["id"].Value;
                 QuoteBasisEnum ob = new QuoteBasisEnum(quoteBasisNode);
                 IDManager.SetID(quoteBasisIDRef_, ob);
             }
             else if (quoteBasisNode.Attributes["href"] != null)
             {
                 quoteBasisIDRef_ = quoteBasisNode.Attributes["href"].Value;
             }
             else
             {
                 quoteBasis_ = new QuoteBasisEnum(quoteBasisNode);
             }
         }
         else
         {
             quoteBasis_ = new QuoteBasisEnum(quoteBasisNode);
         }
     }
     
 
 }
        public QuotedCurrencyPair(XmlNode xmlNode)
        {
            XmlNode currency1Node = xmlNode.SelectSingleNode("currency1");

            if (currency1Node != null)
            {
                if (currency1Node.Attributes["href"] != null || currency1Node.Attributes["id"] != null)
                {
                    if (currency1Node.Attributes["id"] != null)
                    {
                        currency1IDRef_ = currency1Node.Attributes["id"].Value;
                        Currency ob = new Currency(currency1Node);
                        IDManager.SetID(currency1IDRef_, ob);
                    }
                    else if (currency1Node.Attributes["href"] != null)
                    {
                        currency1IDRef_ = currency1Node.Attributes["href"].Value;
                    }
                    else
                    {
                        currency1_ = new Currency(currency1Node);
                    }
                }
                else
                {
                    currency1_ = new Currency(currency1Node);
                }
            }


            XmlNode currency2Node = xmlNode.SelectSingleNode("currency2");

            if (currency2Node != null)
            {
                if (currency2Node.Attributes["href"] != null || currency2Node.Attributes["id"] != null)
                {
                    if (currency2Node.Attributes["id"] != null)
                    {
                        currency2IDRef_ = currency2Node.Attributes["id"].Value;
                        Currency ob = new Currency(currency2Node);
                        IDManager.SetID(currency2IDRef_, ob);
                    }
                    else if (currency2Node.Attributes["href"] != null)
                    {
                        currency2IDRef_ = currency2Node.Attributes["href"].Value;
                    }
                    else
                    {
                        currency2_ = new Currency(currency2Node);
                    }
                }
                else
                {
                    currency2_ = new Currency(currency2Node);
                }
            }


            XmlNode quoteBasisNode = xmlNode.SelectSingleNode("quoteBasis");

            if (quoteBasisNode != null)
            {
                if (quoteBasisNode.Attributes["href"] != null || quoteBasisNode.Attributes["id"] != null)
                {
                    if (quoteBasisNode.Attributes["id"] != null)
                    {
                        quoteBasisIDRef_ = quoteBasisNode.Attributes["id"].Value;
                        QuoteBasisEnum ob = new QuoteBasisEnum(quoteBasisNode);
                        IDManager.SetID(quoteBasisIDRef_, ob);
                    }
                    else if (quoteBasisNode.Attributes["href"] != null)
                    {
                        quoteBasisIDRef_ = quoteBasisNode.Attributes["href"].Value;
                    }
                    else
                    {
                        quoteBasis_ = new QuoteBasisEnum(quoteBasisNode);
                    }
                }
                else
                {
                    quoteBasis_ = new QuoteBasisEnum(quoteBasisNode);
                }
            }
        }