Example #1
0
        private void ReadXml(XmlReader r)
        {
            try
            {
                double bid, ask, high, low;
                DateTime date;
                RateDirection direction;

                if (r.MoveToAttribute("Symbol")) { symbol = r.Value; }
                r.Read();
                r.Read();
                bid = r.ReadElementContentAsDouble("Bid", ""); r.Read();
                ask = r.ReadElementContentAsDouble("Ask", ""); r.Read();
                high = r.ReadElementContentAsDouble("High", ""); r.Read();
                low = r.ReadElementContentAsDouble("Low", ""); r.Read();
                direction = (RateDirection)r.ReadElementContentAsInt("Direction", ""); r.Read();
                date = r.ReadElementContentAsDateTime("Last", ""); r.Read();
                r.Read();
                RateData tempData = new RateData(bid, ask, high, low, date, direction);
                data.Add(tempData);
            }
            catch (Exception e) { throw e; }
        }
Example #2
0
 public Rate(string symbol, RateData data)
 {
     this.symbol = symbol;
     this.data = new List<RateData>();
     this.data.Add(data);
 }