public void UpdateThreadStoreStats() { ThreadStoreStats stats; if (StoreStats == null) { stats = new ThreadStoreStats(); StoreStats = stats; } else { stats = StoreStats; } int totalCount = 0; foreach (string board in Program.ValidBoards.Keys) { int threadCount = CountThreads(board); stats[board] = threadCount; totalCount += threadCount; } stats.TotalArchivedThreadsCount = totalCount; }