C# Class MonoMobile.Views.Utilities.ImageLoader

Network image loader, with local file system cache and in-memory cache
By default, using the static public methods will use an in-memory cache for 50 images and 4 megs total. The behavior of the static methods can be modified by setting the public DefaultLoader property to a value that the user configured. The instance methods can be used to create different imageloader with different properties. Keep in mind that the phone does not have a lot of memory, and using the cache with the unlimited value (0) even with a number of items in the cache can consume memory very quickly. Use the Purge method to release all the memory kept in the caches on low memory conditions, or when the application is sent to the background.
Afficher le fichier Open project: RobertKozak/MonoMobile.Views Class Usage Examples

Méthodes publiques

Свойство Type Description
BaseDir string
DefaultLoader ImageLoader

Méthodes publiques

Méthode Description
DefaultRequestImage ( Uri uri, IImageUpdated notify, string>.IDictionary headers = null ) : UIImage

Requests an image to be loaded using the default image loader

ImageLoader ( int cacheSize, int memoryLimit ) : System

Creates a new instance of the image loader

Purge ( ) : void

Purges the contents of the DefaultLoader

PurgeCache ( ) : void

Purges the cache of this instance of the ImageLoader, releasing all the memory used by the images in the caches.

RequestImage ( Uri uri, IImageUpdated notify, string>.IDictionary headers = null ) : UIImage

Requests an image to be loaded from the network

Private Methods

Méthode Description
Download ( Uri uri, string target, string>.IDictionary headers = null ) : bool
ImageLoader ( ) : System
NotifyImageListeners ( ) : void
QueueRequest ( Uri uri, string target, IImageUpdated notify, string>.IDictionary headers = null ) : void
StartPicDownload ( Uri uri, string target, string>.IDictionary headers = null ) : void
_StartPicDownload ( Uri uri, string target, string>.IDictionary headers = null ) : void
hex ( int v ) : int
md5 ( string input ) : string
sizer ( UIImage img ) : int

Method Details

DefaultRequestImage() public static méthode

Requests an image to be loaded using the default image loader
public static DefaultRequestImage ( Uri uri, IImageUpdated notify, string>.IDictionary headers = null ) : UIImage
uri System.Uri /// The URI for the image to load ///
notify IImageUpdated /// A class implementing the IImageUpdated interface that will be invoked when the image has been loaded ///
headers string>.IDictionary
Résultat UIImage

ImageLoader() public méthode

Creates a new instance of the image loader
public ImageLoader ( int cacheSize, int memoryLimit ) : System
cacheSize int /// The maximum number of entries in the LRU cache ///
memoryLimit int /// The maximum number of bytes to consume by the image loader cache. ///
Résultat System

Purge() public static méthode

Purges the contents of the DefaultLoader
public static Purge ( ) : void
Résultat void

PurgeCache() public méthode

Purges the cache of this instance of the ImageLoader, releasing all the memory used by the images in the caches.
public PurgeCache ( ) : void
Résultat void

RequestImage() public méthode

Requests an image to be loaded from the network
public RequestImage ( Uri uri, IImageUpdated notify, string>.IDictionary headers = null ) : UIImage
uri System.Uri /// The URI for the image to load ///
notify IImageUpdated /// A class implementing the IImageUpdated interface that will be invoked when the image has been loaded ///
headers string>.IDictionary
Résultat UIImage

Property Details

BaseDir public_oe static_oe property

public static string BaseDir
Résultat string

DefaultLoader public_oe static_oe property

This contains the default loader which is configured to be 50 images up to 4 megs of memory. Assigning to this property a new value will change the behavior. This property is lazyly computed, the first time an image is requested.
public static ImageLoader,MonoMobile.Views.Utilities DefaultLoader
Résultat ImageLoader