ARCed.Helpers.Cache.Clear C# (CSharp) Method

Clear() public static method

Disposes all cached images and clears all keys and values of the dictionary
public static Clear ( ) : void
return void
        public static void Clear()
        {
            var cacheGeneration = GC.GetGeneration(_cache);
            try
            {
                foreach (var image in _cache.Values.Where(image => image != null))
                    image.Dispose();
            }
            finally
            {
                _cache.Clear();
                GC.Collect(cacheGeneration, GCCollectionMode.Forced);
            }
        }