Example #1
0
 /// <summary>
 /// Clears the internal Engine caches.
 /// </summary>
 public static void ClearCache()
 {
     CacheInvalidator.InvalidateCaches(ClrProvider);
     UserTypeMetadataCaches.InvalidateCache();
     GlobalCache.Processes.Clear();
     GlobalCache.Caches.InvalidateCache();
 }
Example #2
0
 /// <summary>
 /// Clears the internal Engine caches.
 /// </summary>
 public static void ClearCache()
 {
     CacheInvalidator.InvalidateCaches(ClrProvider);
     GlobalCache.Processes.Clear();
     GlobalCache.UserTypeCastedVariableCollections.Clear();
     GlobalCache.UserTypeCastedVariables.Clear();
     GlobalCache.VariablesUserTypeCastedFields.Clear();
     GlobalCache.VariablesUserTypeCastedFieldsByName.Clear();
 }
Example #3
0
        public void InvalidateStruct()
        {
            DifferentCachesStruct differentCaches = new DifferentCachesStruct(false);

            Assert.False(differentCaches.simpleCache.Cached);
            Assert.False(differentCaches.simpleCacheStruct.Cached);
            Assert.Equal(42, differentCaches.SimpleCacheValue);
            Assert.Equal(42, differentCaches.SimpleCacheStructValue);
            Assert.True(differentCaches.simpleCache.Cached);
            Assert.True(differentCaches.simpleCacheStruct.Cached);
            CacheInvalidator.InvalidateCaches(ref differentCaches);
            Assert.False(differentCaches.simpleCache.Cached);
            Assert.False(differentCaches.simpleCacheStruct.Cached);
        }
Example #4
0
        public void InvalidateCaches()
        {
            DictionaryCache <int, string> dictionaryCache;
            SimpleCache <int>             simpleCache;
            CacheTestClass test = new CacheTestClass();

            test.CacheInvalidator = new CacheInvalidator();
            dictionaryCache       = test.CacheInvalidator.CreateDictionaryCache <int, string>(key => key.ToString());
            simpleCache           = test.CacheInvalidator.CreateSimpleCache(() => 42);
            dictionaryCache.TryGetValue(simpleCache.Value, out string testValue);
            CacheInvalidator.InvalidateCaches(test);
            CacheInvalidator.InvalidateCaches <CacheTestClass>(null);
            CacheInvalidator.InvalidateCaches(new CacheTestClass());
            Assert.Equal(0, dictionaryCache.Count);
            Assert.False(simpleCache.Cached);
        }
Example #5
0
        public void InvalidateObject()
        {
            DifferentCaches differentCaches = new DifferentCaches();

            Assert.False(differentCaches.simpleCache.Cached);
            Assert.False(differentCaches.simpleCacheStruct.Cached);
            Assert.False(differentCaches.simpleCacheWithContext.Cached);
            Assert.Equal(42, differentCaches.SimpleCacheValue);
            Assert.Equal(42, differentCaches.SimpleCacheStructValue);
            Assert.Equal(42, differentCaches.SimpleCacheWithContextValue);
            Assert.True(differentCaches.simpleCache.Cached);
            Assert.True(differentCaches.simpleCacheStruct.Cached);
            Assert.True(differentCaches.simpleCacheWithContext.Cached);
            CacheInvalidator.InvalidateCaches(differentCaches);
            Assert.False(differentCaches.simpleCache.Cached);
            Assert.False(differentCaches.simpleCacheStruct.Cached);
            Assert.False(differentCaches.simpleCacheWithContext.Cached);
        }
Example #6
0
 /// <summary>
 /// Invalidates cache structures.
 /// Use when memory state changes (e.g. during live debugging).
 /// </summary>
 public void InvalidateProcessCache()
 {
     CacheInvalidator.InvalidateCaches(this);
 }