BusterWood.Caching/CacheExtensions.cs
/// <summary>Returns a snapshot of the keys in the cache at a point in time</summary>
Returns a snapshot of the keys in the cache at a point in time
Returns a snapshot of the keys in the cache at a point in time
public static TKey[] Keys<TKey, TValue>(this Cache<TKey, TValue> cache)
        {
            lock (cache.SyncRoot)
            {
                var keys = new TKey[cache.Count];
                cache._gen0.Keys.CopyTo(keys, 0);
                if (cache._gen1 != null)
                    cache._gen1.Keys.CopyTo(keys, cache._gen0.Count);
                return keys;
            }
        }
public static TKey [ ] Keys < TKey , TValue > ( this Cache < TKey , TValue > cache ) { lock ( cache . SyncRoot ) { var keys = new TKey [ cache . Count ] ; cache . _gen0 . Keys . CopyTo ( keys , 0 ) ; if ( cache . _gen1 != null ) cache . _gen1 . Keys . CopyTo ( keys , cache . _gen0 . Count ) ; return keys ; } }
Returns a snapshot of the keys in the cache at a point in time
Returns a snapshot of the keys in the cache at a point in time
Cache<TKey, TValue>
this