C# Class ImageProcessor.Web.Caching.ImageCacheBase

The image cache base provides methods for implementing the IImageCache interface. It is recommended that any implementations inherit from this class.
Inheritance: IImageCache
显示文件 Open project: JimBobSquarePants/ImageProcessor

Protected Properties

Property Type Description
FullPath string
Querystring string
RequestPath string

Public Methods

Method Description
AddImageToCacheAsync ( Stream stream, string contentType ) : System.Threading.Tasks.Task

Adds the image to the cache in an asynchronous manner.

CreateCachedFileNameAsync ( ) : Task

Gets a string identifying the cached file name.

IsNewOrUpdatedAsync ( ) : Task

Gets a value indicating whether the image is new or updated in an asynchronous manner.

RewritePath ( HttpContext context ) : void

Rewrites the path to point to the cached image.

TrimCacheAsync ( ) : System.Threading.Tasks.Task

Trims the cache of any expired items in an asynchronous manner.

Protected Methods

Method Description
AugmentSettings ( string>.Dictionary settings ) : void

Provides a means to augment the cache settings taken from the configuration in derived classes. This allows for configuration of cache objects outside the normal configuration files, for example by using app settings in the Azure platform.

ImageCacheBase ( string requestPath, string fullPath, string querystring ) : System

Initializes a new instance of the ImageCacheBase class.

IsExpired ( System.DateTime creationDate ) : bool

Gets a value indicating whether the given images creation date is out with the prescribed limit.

Private Methods

Method Description
AugmentSettingsCore ( string>.Dictionary settings ) : string>.Dictionary

Provides an entry point to augmentation of the Settings dictionary

Method Details

AddImageToCacheAsync() public abstract method

Adds the image to the cache in an asynchronous manner.
public abstract AddImageToCacheAsync ( Stream stream, string contentType ) : System.Threading.Tasks.Task
stream Stream /// The stream containing the image data. ///
contentType string /// The content type of the image. ///
return System.Threading.Tasks.Task

AugmentSettings() protected method

Provides a means to augment the cache settings taken from the configuration in derived classes. This allows for configuration of cache objects outside the normal configuration files, for example by using app settings in the Azure platform.
protected AugmentSettings ( string>.Dictionary settings ) : void
settings string>.Dictionary The current settings.
return void

CreateCachedFileNameAsync() public method

Gets a string identifying the cached file name.
public CreateCachedFileNameAsync ( ) : Task
return Task

ImageCacheBase() protected method

Initializes a new instance of the ImageCacheBase class.
protected ImageCacheBase ( string requestPath, string fullPath, string querystring ) : System
requestPath string /// The request path for the image. ///
fullPath string /// The full path for the image. ///
querystring string /// The querystring containing instructions. ///
return System

IsExpired() protected method

Gets a value indicating whether the given images creation date is out with the prescribed limit.
protected IsExpired ( System.DateTime creationDate ) : bool
creationDate System.DateTime /// The creation date. ///
return bool

IsNewOrUpdatedAsync() public abstract method

Gets a value indicating whether the image is new or updated in an asynchronous manner.
public abstract IsNewOrUpdatedAsync ( ) : Task
return Task

RewritePath() public abstract method

Rewrites the path to point to the cached image.
public abstract RewritePath ( HttpContext context ) : void
context System.Web.HttpContext /// The encapsulating all information about the request. ///
return void

TrimCacheAsync() public abstract method

Trims the cache of any expired items in an asynchronous manner.
public abstract TrimCacheAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Property Details

FullPath protected_oe property

The full path for the image.
protected string FullPath
return string

Querystring protected_oe property

The querystring containing processing instructions.
protected string Querystring
return string

RequestPath protected_oe property

The request path for the image.
protected string RequestPath
return string