CacheImageProvider
Represents a provider for images of a RadImageEditor instance. It stores the images into Cache or Session.
Definition
Namespace:Telerik.Web.UI.ImageEditor
Assembly:Telerik.Web.UI.dll
Syntax:
public class CacheImageProvider : ICacheImageProvider
Inheritance: objectCacheImageProvider
Implements:
Inherited Members
Constructors
Creates an instance of the CacheImageProvider class.
public CacheImageProvider()
Creates an instance of the CacheImageProvider class.
public CacheImageProvider(ImageStorage storage, string imageStorageKey)
The ImageStorage location where the EditableImage objects will be stored.
imageStorageKeystringThe unique key associated with the current instance of the RadImageEditor.
Creates an instance of the CacheImageProvider class.
public CacheImageProvider(ImageStorage storage)
The ImageStorage location where the EditableImage objects will be stored.
Properties
Gets or sets a unique key that used to associate the current RadImageEditor instance with the images stored by the provider. This property is set by the RadImageEditor instance.
The RadImageEditor class provides exactly the same property, and the provider and the corresponding ImageEditor instance have the same value.
public string ImageStorageKey { get; set; }
Implements:
Gets or sets the location where the EditableImage objects will be stored. This property is set by the RadImageEditor instance.
public ImageStorage Storage { get; set; }
Implements:
Methods
Clears all images currently saved by the provider.
public virtual void ClearImages()
Implements:
Clears the images in the provider up to the image key passed.
The clearing is done from the first image that was placed by the provider, up to the one corresponding to the key. The image that corresponds to the key is not cleared.
public virtual void ClearImages(string imageKey)
The key up to which the images are cleared.
Implements:
Deletes a file from the FileSystem and returns a string.Empty if the action was successful.
protected virtual string DeleteFile(string physicalPath)
The physical path to the file.
Returns:String.Empty if the deletion was successful.
"FileReadOnly" if the file exists and it is read only. The file is not deleted.
"NoPermissionsToDeleteFile" if the deletion was successful. The file is not deleted.
Loads an image from the specified location. This image will be used to create an EditableImage object.
public virtual Image LoadImage(string imageUrl, string physicalPath, HttpContext context)
The path to the image to load.
physicalPathstringThe physical path to the image to load.
contextHttpContextThe HttpContext to which the application belongs.
Returns:Returns the Image object loaded from the specified location.
Implements:
Retrieves an EditableImage from the provider.
public virtual EditableImage Retrieve(string key)
The key that corresponds to the editable image.
Returns:An EditableImage object that corresponds to the key passed.
Implements:
Saves the current image on the FileSystem and returns a string.Empty if the saving was successful.
public virtual string SaveImage(EditableImage editableImage, string physicalPath, string imageUrl, bool overwrite)
The EditableImage to save.
physicalPathstringThe full physical path (including the file name) where the image will be saved.
imageUrlstringThe path (relative) to the image that is currently loaded in the ImageEditor. If new image name was specified when saving the image, it will be reflected in the imageUrl.
overwriteboolShould we overwrite the file if it exists.
Returns:String.Empty if the operation was successful, else a string indicating the problem.
Implements:
Stores an image, generates key that corresponds to the stored image, and returns the key.
public virtual string Store(EditableImage image)
The EditableImage object to store.
Returns:The key that corresponds to the stored editable image.
Implements: