Ejemplo n.º 1
0
        private void ReadHoliday(XmlDocument doc)
        {
            XmlElement  elemHoliday = (XmlElement)doc.GetElementsByTagName("HOLIDAY")[0];
            string      openTimeId  = elemHoliday.GetAttribute("OPENID");
            XmlNodeList nodes       = elemHoliday.ChildNodes;

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode node = nodes[i];
                this.set_Holiday.Add(int.Parse(((XmlElement)node).GetAttribute("TIME")));
            }
            this.holidayItem = dicOpenPeriod[openTimeId];
        }
Ejemplo n.º 2
0
        public void LoadConfig(XmlElement elem)
        {
            this.ID = elem.GetAttribute("ID");
            String time = elem.GetAttribute("TIME");

            String[] timeArr = time.Split('-');
            string   str     = timeArr[0];

            if (str.Equals(""))
            {
                StartTime = int.MinValue;
            }
            else
            {
                StartTime = int.Parse(str);
            }

            str = timeArr[1];
            if (str.Equals(""))
            {
                EndTime = int.MaxValue;
            }
            else
            {
                EndTime = int.Parse(str);
            }

            string openid = elem.GetAttribute("OPENID");

            if (openid.Equals(""))
            {
                Period = dataLoader.defaultOpenTime;
            }
            else
            {
                Period = dataLoader.GetOpenPeriod(openid);
            }

            for (int i = 0; i < elem.ChildNodes.Count; i++)
            {
                XmlNode node = elem.ChildNodes[i];
                if (node is XmlElement)
                {
                    XmlElement             ee      = (XmlElement)node;
                    TradingSession_Variety variety = new TradingSession_Variety();
                    variety.BelongMarket = this;
                    variety.LoadConfig(ee);
                    varieties.Add(variety);
                }
            }
        }
Ejemplo n.º 3
0
        private TradingSessionDetail_Item ReadTimePeriod(XmlElement elem)
        {
            TradingSessionDetail_Item period = new TradingSessionDetail_Item();

            period.ID = elem.GetAttribute("ID");
            for (int i = 0; i < elem.ChildNodes.Count; i++)
            {
                XmlElement ee     = (XmlElement)elem.ChildNodes[i];
                double     fstart = double.Parse(ee.GetAttribute("START"));
                double     fend   = double.Parse(ee.GetAttribute("END"));
                double[]   ff     = new double[2];
                ff[0] = fstart;
                ff[1] = fend;
                period.OpenTime.Add(ff);
            }
            return(period);
        }
Ejemplo n.º 4
0
        private void ReadOpenTime(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;
                    TradingSessionDetail_Item period = ReadTimePeriod(subNode);
                    dicOpenPeriod.Add(period.ID, period);
                }
            }
            String openid = elem.GetAttribute("DEFAULT");

            this.defaultOpenTime = dicOpenPeriod[openid];
        }
Ejemplo n.º 5
0
        public void LoadConfig(XmlElement elem)
        {
            String IDStr = elem.GetAttribute("ID");

            String[] ids = IDStr.Split(',');
            foreach (String id in ids)
            {
                set.Add(id);
            }
            String time = elem.GetAttribute("TIME");

            String[] timeArr = time.Split('-');
            string   str     = timeArr[0];

            if (str.Equals(""))
            {
                StartTime = int.MinValue;
            }
            else
            {
                StartTime = int.Parse(str);
            }

            str = timeArr[1];
            if (str.Equals(""))
            {
                EndTime = int.MaxValue;
            }
            else
            {
                EndTime = int.Parse(str);
            }

            string openid = elem.GetAttribute("OPENID");

            if (openid.Equals(""))
            {
                Period = BelongMarket.Period;
            }
            else
            {
                Period = BelongMarket.dataLoader.GetOpenPeriod(openid);
            }
        }