void RefreshDbs(object sender, System.Timers.ElapsedEventArgs e) { //refresh Dbs in the background SafeThread refreshThread = new SafeThread(delegate() { logger.Log("Homestore refresh was triggered"); //refresh into this temporary db HomeStoreDb tmpStoreDb = new HomeStoreDb(logger); tmpStoreDb.Populate(); //do a switch now lock (this) { storeDb = tmpStoreDb; } lastRefreshed = DateTime.Now; }, "homestore refresh", logger); refreshThread.Start(); }