C# Class FlickrNet.PersistentCache

A threadsafe cache that is backed by disk storage. All public methods that read or write state must be protected by the lockFile. Private methods should not acquire the lockFile as it is not reentrant.
Exibir arquivo Open project: mono/flickr-sharp

Public Methods

Method Description
Flush ( ) : void
Get ( string key, System.TimeSpan maxAge, bool removeIfExpired ) : ICacheItem
PersistentCache ( string filename, CacheItemPersister persister, long maxSize ) : System
Shrink ( long size ) : void
ToArray ( Type valueType ) : ICacheItem[]

Return all items in the cache. Works similarly to ArrayList.ToArray(Type).

this ( string key ) : ICacheItem

Gets or sets cache values.

Private Methods

Method Description
Expired ( System.DateTime test, System.TimeSpan age ) : bool
InternalGet ( string key ) : ICacheItem
InternalGetAll ( Type valueType, string &keys, Array &values ) : void
InternalSet ( string key, ICacheItem value ) : ICacheItem
Load ( Stream s ) : Hashtable
Persist ( ) : void
Refresh ( ) : void
RemoveKey ( string key ) : ICacheItem
Store ( Stream s, Hashtable table ) : void

Method Details

Flush() public method

public Flush ( ) : void
return void

Get() public method

public Get ( string key, System.TimeSpan maxAge, bool removeIfExpired ) : ICacheItem
key string
maxAge System.TimeSpan
removeIfExpired bool
return ICacheItem

PersistentCache() public method

public PersistentCache ( string filename, CacheItemPersister persister, long maxSize ) : System
filename string
persister CacheItemPersister
maxSize long
return System

Shrink() public method

public Shrink ( long size ) : void
size long
return void

ToArray() public method

Return all items in the cache. Works similarly to ArrayList.ToArray(Type).
public ToArray ( Type valueType ) : ICacheItem[]
valueType System.Type
return ICacheItem[]

this() public method

Gets or sets cache values.
public this ( string key ) : ICacheItem
key string
return ICacheItem