Exemple #1
0
        private static void OnAccentColorServiceAccentColorChanged(object sender, EventArgs e)
        {
            Log.Debug("Accent color has changed, clearing current cache");

            _accentColorBrushCache = null;
            _themeColorBrushesCache.Clear();
            _themeColorsCache.Clear();
        }
Exemple #2
0
        public void IsRootDirRemovedOnClear()
        {
            var storage = new CacheStorage(_tempDir);

            storage.Clear();

            Assert.False(Directory.Exists(_tempDir));
        }
Exemple #3
0
        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;
        }
Exemple #4
0
            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);
            }
Exemple #5
0
            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);
            }
Exemple #6
0
 public void Dispose()
 {
     _storage.Clear();
 }