예제 #1
0
        /// <summary>
        /// Generates a random time of day with a frequency that matches the times when the most images are captured (e.g. more images are
        /// taken at 1pm than at 8pm
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public TimeSpan GetRandomTimeOfDay(Random r)
        {
            var ts = new TimeSpan(0, HourOfDay.GetRandom(r), r.Next(60), r.Next(60), 0);

            ts = ts.Subtract(new TimeSpan(ts.Days, 0, 0, 0));

            if (ts.Days != 0)
            {
                throw new Exception("What!");
            }

            return(ts);
        }
예제 #2
0
 public string GetRandomImageType(Random r)
 {
     return(ImageType.GetRandom(r));
 }