C# Class FFImageLoading.Cache.SimpleDiskCache

Inheritance: IDiskCache
Show file Open project: daniel-luberda/FFImageLoading

Public Methods

Method Description
AddToSavingQueueIfNotExistsAsync ( string key, byte bytes, System.TimeSpan duration ) : Task

Adds the file to cache and file saving queue if it does not exists.

ClearAsync ( ) : Task

Clears all cache entries.

CreateCache ( string cacheName, Configuration configuration ) : SimpleDiskCache

Creates new cache default instance.

ExistsAsync ( string key ) : Task

Checks if cache entry exists/

GetFilePathAsync ( string key ) : Task
RemoveAsync ( string key ) : Task

Removes the specified cache entry.

SimpleDiskCache ( string cachePath, Configuration configuration ) : System

Initializes a new instance of the FFImageLoading.Cache.SimpleDiskCache class.

TryGetStreamAsync ( string key ) : Task

Tries to get cached file as stream.

Protected Methods

Method Description
CleanCallback ( ) : Task
CleanCallback ( object state ) : void
GetDuration ( string text ) : System.TimeSpan
Init ( ) : Task
InitializeEntries ( ) : Task
InitializeEntries ( ) : void
WaitForPendingWriteIfExists ( string key ) : Task

Method Details

AddToSavingQueueIfNotExistsAsync() public method

Adds the file to cache and file saving queue if it does not exists.
public AddToSavingQueueIfNotExistsAsync ( string key, byte bytes, System.TimeSpan duration ) : Task
key string Key to store/retrieve the file.
bytes byte File data in bytes.
duration System.TimeSpan Specifies how long an item should remain in the cache.
return Task

CleanCallback() protected method

protected CleanCallback ( ) : Task
return Task

CleanCallback() protected method

protected CleanCallback ( object state ) : void
state object
return void

ClearAsync() public method

Clears all cache entries.
public ClearAsync ( ) : Task
return Task

CreateCache() public static method

Creates new cache default instance.
public static CreateCache ( string cacheName, Configuration configuration ) : SimpleDiskCache
cacheName string Cache name.
configuration Configuration
return SimpleDiskCache

ExistsAsync() public method

Checks if cache entry exists/
public ExistsAsync ( string key ) : Task
key string Key.
return Task

GetDuration() protected method

protected GetDuration ( string text ) : System.TimeSpan
text string
return System.TimeSpan

GetFilePathAsync() public method

public GetFilePathAsync ( string key ) : Task
key string
return Task

Init() protected method

protected Init ( ) : Task
return Task

InitializeEntries() protected method

protected InitializeEntries ( ) : Task
return Task

InitializeEntries() protected method

protected InitializeEntries ( ) : void
return void

RemoveAsync() public method

Removes the specified cache entry.
public RemoveAsync ( string key ) : Task
key string Key.
return Task

SimpleDiskCache() public method

Initializes a new instance of the FFImageLoading.Cache.SimpleDiskCache class.
public SimpleDiskCache ( string cachePath, Configuration configuration ) : System
cachePath string Cache path.
configuration Configuration
return System

TryGetStreamAsync() public method

Tries to get cached file as stream.
public TryGetStreamAsync ( string key ) : Task
key string Key.
return Task

WaitForPendingWriteIfExists() protected method

protected WaitForPendingWriteIfExists ( string key ) : Task
key string
return Task