private static void OnAccentColorServiceAccentColorChanged(object sender, EventArgs e) { Log.Debug("Accent color has changed, clearing current cache"); _accentColorBrushCache = null; _themeColorBrushesCache.Clear(); _themeColorsCache.Clear(); }
public void IsRootDirRemovedOnClear() { var storage = new CacheStorage(_tempDir); storage.Clear(); Assert.False(Directory.Exists(_tempDir)); }
private void OnThemeManagerThemeChanged(object sender, ThemeChangedEventArgs e) { Log.Debug("Theme has changed, clearing current cache"); _accentColorBrushCache = null; _resourceBrushesCache.Clear(); _themeColorBrushesCache.Clear(); _themeColorsCache.Clear(); _currentTheme = e.NewTheme; }
public void DoesNotDisposeItemsOnClearWhenDisposingNotEnabled() { var disposable = new CustomDisposable(); var cache = new CacheStorage <string, CustomDisposable>(); cache.ExpirationTimerInterval = TimeSpan.FromMilliseconds(250); cache.Add("disposable", disposable, expiration: TimeSpan.FromMilliseconds(250)); Assert.IsFalse(disposable.IsDiposed); cache.Clear(); Assert.IsFalse(disposable.IsDiposed); }
public void DoesNotDisposeItemsOnClearWhenDisposingNotEnabled() { var disposable = new CustomDisposable(); var cache = new CacheStorage<string, CustomDisposable>(); cache.ExpirationTimerInterval = TimeSpan.FromMilliseconds(250); cache.Add("disposable", disposable, expiration: TimeSpan.FromMilliseconds(250)); Assert.IsFalse(disposable.IsDiposed); cache.Clear(); Assert.IsFalse(disposable.IsDiposed); }
public void Dispose() { _storage.Clear(); }