コード例 #1
0
 /// <summary>各要素から株価情報を生成</summary>
 static SerializablePrices parse(IEnumerable <string> items)
 {
     try {
         var sp = new SerializablePrices();
         sp.Date         = DateTime.Parse(items.ElementAt(0));
         sp.OpeningPrice = double.Parse(items.ElementAt(1));
         sp.High         = double.Parse(items.ElementAt(2));
         sp.Low          = double.Parse(items.ElementAt(3));
         sp.ClosingPrice = double.Parse(items.ElementAt(4));
         if (7 <= items.Count())
         {
             sp.Turnover     = double.Parse(items.ElementAt(5));
             sp.AdjustedRate = sp.ClosingPrice / double.Parse(items.ElementAt(6));
         }
         return(sp);
     } catch {
         throw;
     }
 }
コード例 #2
0
 internal Prices(SerializablePrices stockPrices)
 {
     sp = stockPrices;
 }