C# Class FFImageLoading.ImageService

Show file Open project: daniel-luberda/FFImageLoading

Private Properties

Property Type Description
ImageService System.Collections.Generic
InitializeIfNeeded void

Public Methods

Method Description
Cancel ( bool>.Func predicate ) : void

Cancels tasks that match predicate.

Cancel ( bool>.Func predicate ) : void

Cancels tasks that match predicate.

CancelWorkFor ( IImageLoaderTask task ) : void

Cancel any loading work for the given ImageView

Initialize ( ) : void

Initializes FFImageLoading with a default Configuration. Also forces to run disk cache cleaning routines (avoiding delay for first image loading tasks)

Initialize ( Configuration configuration ) : void

Initializes FFImageLoading with a given Configuration. It allows to configure and override most of it. Also forces to run disk cache cleaning routines (avoiding delay for first image loading tasks)

InvalidateCacheAsync ( CacheType cacheType ) : Task

Invalidates selected caches.

InvalidateCacheEntryAsync ( string key, CacheType cacheType, bool removeSimilar = false ) : Task

Invalidates the cache for given key.

InvalidateDiskCacheAsync ( ) : Task

Invalidates the disk cache.

InvalidateMemoryCache ( ) : void

Invalidates the memory cache.

LoadCompiledResource ( string resourceName ) : TaskParameter

Constructs a new TaskParameter to load an image from a compiled drawable resource.

LoadFile ( string filepath ) : TaskParameter

Constructs a new TaskParameter to load an image from a file.

LoadFileFromApplicationBundle ( string filepath ) : TaskParameter

Constructs a new TaskParameter to load an image from a file from application bundle.

LoadImage ( IImageLoaderTask task ) : void

Queue an image loading task.

LoadStream ( Func stream ) : TaskParameter

Constructs a new TaskParameter to load an image from a Stream.

LoadUrl ( string url, System.TimeSpan cacheDuration = null ) : TaskParameter

Constructs a new TaskParameter to load an image from a URL.

RemovePendingTask ( IImageLoaderTask task ) : void

Removes a pending image loading task from the work queue.

SetExitTasksEarly ( bool exitTasksEarly ) : void

Sets a value indicating whether ImageService will exit tasks earlier

SetPauseWork ( bool pauseWork ) : void

Sets a value indicating if all loading work should be paused (silently canceled).

Private Methods

Method Description
ImageService ( ) : System.Collections.Generic
InitializeIfNeeded ( Configuration userDefinedConfig = null ) : void

Method Details

Cancel() public method

Cancels tasks that match predicate.
public Cancel ( bool>.Func predicate ) : void
predicate bool>.Func Predicate for finding relevant tasks to cancel.
return void

Cancel() public method

Cancels tasks that match predicate.
public Cancel ( bool>.Func predicate ) : void
predicate bool>.Func Predicate for finding relevant tasks to cancel.
return void

CancelWorkFor() public method

Cancel any loading work for the given ImageView
public CancelWorkFor ( IImageLoaderTask task ) : void
task IImageLoaderTask Image loading task to cancel.
return void

Initialize() public method

Initializes FFImageLoading with a default Configuration. Also forces to run disk cache cleaning routines (avoiding delay for first image loading tasks)
public Initialize ( ) : void
return void

Initialize() public method

Initializes FFImageLoading with a given Configuration. It allows to configure and override most of it. Also forces to run disk cache cleaning routines (avoiding delay for first image loading tasks)
public Initialize ( Configuration configuration ) : void
configuration FFImageLoading.Config.Configuration Configuration.
return void

InvalidateCacheAsync() public method

Invalidates selected caches.
public InvalidateCacheAsync ( CacheType cacheType ) : Task
cacheType CacheType Memory cache, Disk cache or both
return Task

InvalidateCacheEntryAsync() public method

Invalidates the cache for given key.
public InvalidateCacheEntryAsync ( string key, CacheType cacheType, bool removeSimilar = false ) : Task
key string Concerns images with this key.
cacheType CacheType Memory cache, Disk cache or both
removeSimilar bool If similar keys should be removed, ie: typically keys with extra transformations
return Task

InvalidateDiskCacheAsync() public method

Invalidates the disk cache.
public InvalidateDiskCacheAsync ( ) : Task
return Task

InvalidateMemoryCache() public method

Invalidates the memory cache.
public InvalidateMemoryCache ( ) : void
return void

LoadCompiledResource() public method

Constructs a new TaskParameter to load an image from a compiled drawable resource.
public LoadCompiledResource ( string resourceName ) : TaskParameter
resourceName string Name of the resource in drawable folder without extension
return FFImageLoading.Work.TaskParameter

LoadFile() public method

Constructs a new TaskParameter to load an image from a file.
public LoadFile ( string filepath ) : TaskParameter
filepath string Path to the file.
return FFImageLoading.Work.TaskParameter

LoadFileFromApplicationBundle() public method

Constructs a new TaskParameter to load an image from a file from application bundle.
public LoadFileFromApplicationBundle ( string filepath ) : TaskParameter
filepath string Path to the file.
return FFImageLoading.Work.TaskParameter

LoadImage() public method

Queue an image loading task.
public LoadImage ( IImageLoaderTask task ) : void
task IImageLoaderTask Image loading task.
return void

LoadStream() public method

Constructs a new TaskParameter to load an image from a Stream.
public LoadStream ( Func stream ) : TaskParameter
stream Func
return FFImageLoading.Work.TaskParameter

LoadUrl() public method

Constructs a new TaskParameter to load an image from a URL.
public LoadUrl ( string url, System.TimeSpan cacheDuration = null ) : TaskParameter
url string URL to the file
cacheDuration System.TimeSpan How long the file will be cached on disk
return FFImageLoading.Work.TaskParameter

RemovePendingTask() public method

Removes a pending image loading task from the work queue.
public RemovePendingTask ( IImageLoaderTask task ) : void
task IImageLoaderTask Image loading task to remove.
return void

SetExitTasksEarly() public method

Sets a value indicating whether ImageService will exit tasks earlier
public SetExitTasksEarly ( bool exitTasksEarly ) : void
exitTasksEarly bool If set to true exit tasks early.
return void

SetPauseWork() public method

Sets a value indicating if all loading work should be paused (silently canceled).
public SetPauseWork ( bool pauseWork ) : void
pauseWork bool If set to true pause/cancel work.
return void