Ejemplo n.º 1
0
 public ImageCacheService(ApplicationSettingsService applicationSettingsService, ImageCacheRepository imageCacheRepository)
 {
     _imageCacheRepository = imageCacheRepository;
     if (_imageCacheRepository.CacheSize < MinCacheSize)
     {
         _imageCacheRepository.SetCacheSize(MinCacheSize, CacheTruncatePriority.RemoveLargest);
         applicationSettingsService.SaveSettings();
     }
     applicationSettingsService.OnSettingsSaved  += _applicationSettingsService_OnSettingsChanged;
     applicationSettingsService.OnSettingsLoaded += ApplicationSettingsService_OnSettingsLoaded;
 }
Ejemplo n.º 2
0
 private void DoWork(object state)
 {
     try
     {
         ImageCacheRepository.LoadCache().Wait();
     }
     catch (Exception e)
     {
         Logger.LogError(e, "Error loading cache");
     }
 }