Пример #1
0
        public void Load(XmlDocument doc)
        {
            XmlElement elem = (XmlElement)doc.DocumentElement.ChildNodes[0];

            for (int i = 0; i < elem.ChildNodes.Count; i++)
            {
                XmlNode node = elem.ChildNodes[i];
                if (node is XmlElement)
                {
                    XmlElement     subNode = (XmlElement)node;
                    OpenTimePeriod period  = ReadTimePeriod(subNode);
                    dicOpenPeriod.Add(period.ID, period);
                }
            }

            XmlElement elemMarket = (XmlElement)doc.GetElementsByTagName("MARKETS")[0];

            for (int i = 0; i < elemMarket.ChildNodes.Count; i++)
            {
                XmlNode node = elemMarket.ChildNodes[i];
                if (node is XmlElement)
                {
                    XmlElement     subNode = (XmlElement)node;
                    OpenTimeMarket market  = new OpenTimeMarket();
                    market.Config = this;
                    market.LoadConfig(subNode);
                    Markets.Add(market);
                }
            }

            String openid = elem.GetAttribute("DEFAULT");

            this.defaultOpenTime = dicOpenPeriod[openid];
        }
Пример #2
0
 public List <double[]> GetOpenTime(String market, String variety, int date)
 {
     for (int i = 0; i < Markets.Count; i++)
     {
         OpenTimeMarket  otm      = Markets[i];
         List <double[]> openTime = otm.GetOpenTime(market, variety, date);
         if (openTime != null)
         {
             return(openTime);
         }
     }
     return(defaultOpenTime.OpenTime);
 }