/// <summary> /// Initializes the on. /// </summary> /// <param name="other">The other.</param> public void InitializeOn (StockData other) { this.Symbol = other.Symbol; this.LastTrade = other.LastTrade; this.StockChange = other.StockChange; this.PreviousClose = other.PreviousClose; this.Open = other.Open; this.Volume = other.Volume; }
/// <summary> /// Adds the rows. /// </summary> /// <param name="count">The count.</param> private void AddRows (int count) { for (int i = 0; i < count; ++i) { var newRec = new StockData (); newRec.Symbol = ChangeSymbol (); newRec.Account = ChangeAccount (i); newRec.Open = Math.Round (r.NextDouble () * 30, 2); newRec.LastTrade = Math.Round ((1 + r.NextDouble () * 50)); double d = r.NextDouble (); if (d < .5) newRec.StockChange = Math.Round (d, 2); else newRec.StockChange = Math.Round (d, 2) * -1; newRec.PreviousClose = Math.Round (r.NextDouble () * 30, 2); newRec.Volume = r.Next (); data.Add (newRec); } }