Beispiel #1
0
        public List <FileDiscoveryCache> GetCache(WallpaperTheme theme)
        {
            List <FileDiscoveryCache> cache = FileCacheRepo.GetAllQuery()
                                              .Where(x => x.WallpaperThemeID == theme.ID)
                                              .OrderBy(x => x.FolderPath)
                                              .ThenBy(x => x.FilePath)
                                              .ToList();

            return(cache);
        }
        private void LoadFileCache(IProgress <IndicatorProgressReport> progress)
        {
            if (Theme == null)
            {
                return;
            }

            var cache = FileDiscoveryCacheRepository.GetAllQuery()
                        .Where(x => x.WallpaperThemeID == Theme.ID)
                        .OrderBy(x => x.FilePath)
                        .ToList();

            // If the cache exists, use it
            if (cache.Count > 0)
            {
                SetFileCache(cache);
            }
            else // Otherwise, lets try creating it
            {
                RefreshFileCache(progress);
            }
        }