public ClientComicStat(ComicStat source)
 {
     this.ComicId = source.ComicId;
     this.Funny   = source.Funny;
     this.Smart   = source.Smart;
     this.Random  = source.Random;
     this.Overall = source.Overall;
     this.Period  = (ComicStat.ComicStatPeriod)source.Period;
     this.Readers = source.Readers;
 }
Beispiel #2
0
 public void Start()
 {
     Log.Info("Starting");
     this.UpdateTimer = new System.Threading.Timer(delegate(object state)
     {
         // Attempt to find a connection string matching the current namespace
         ConnectionStringSettings connectionString = ConfigurationManager.ConnectionStrings["ComicModelContext"];
         using (ComicModelContext context = new ComicModelContext(connectionString.ConnectionString))
         {
             context.UpdateComicStat((int)ComicStat.ComicStatPeriod.AllTime, ComicStat.PeriodToCutoff(ComicStat.ComicStatPeriod.AllTime));
             context.UpdateComicStat((int)ComicStat.ComicStatPeriod.Year, ComicStat.PeriodToCutoff(ComicStat.ComicStatPeriod.Year));
             context.UpdateComicStat((int)ComicStat.ComicStatPeriod.Month, ComicStat.PeriodToCutoff(ComicStat.ComicStatPeriod.Month));
             context.UpdateComicStat((int)ComicStat.ComicStatPeriod.Week, ComicStat.PeriodToCutoff(ComicStat.ComicStatPeriod.Week));
             context.UpdateComicStat((int)ComicStat.ComicStatPeriod.Day, ComicStat.PeriodToCutoff(ComicStat.ComicStatPeriod.Day));
         }
     }, null, new TimeSpan(0, 0, 0), new TimeSpan(0, 15, 0));
 }