ICacheImageProvider
Defines the methods and properties that an image provider, for the RadImageEditor's intermediary EditableImage objects, must implement so that the ImageEditor instance will perform server image operations correctly.
Definition
Namespace:Telerik.Web.UI.ImageEditor
Assembly:Telerik.Web.UI.dll
Syntax:
public interface ICacheImageProvider
Derived Classes:
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.
When implementing the property in a class, providing an Auto-Implemented property is enough for the provider to work correctly. The property should not be set, since it is set by the corresponding ImageEditor instance.
string ImageStorageKey { get; set; }
Gets or sets the location where the EditableImage objects will be stored. This property is set by the RadImageEditor instance.
When implementing the property in a class, providing an Auto-Implemented property is enough for the provider to work correctly.
ImageStorage Storage { get; set; }
Methods
Clears all images currently saved by the provider.
void ClearImages()
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.
void ClearImages(string imageKey)
The key up to which the images are cleared.
Loads an image from the specified location. This image will be used to create an EditableImage object.
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.
Retrieves an EditableImage from the provider.
EditableImage Retrieve(string key)
The key that corresponds to the editable image.
Returns:An EditableImage object that corresponds to the key passed.
Saves the image in persistent storage location.
string SaveImage(EditableImage editableImage, string physicalPath, string imageUrl, bool overwrite)
The EditableImage object to store.
physicalPathstringThe physical path (including the file name) where the image will be stored.
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.
overwriteboolBool value indicating whether or not the existing image (if it exists) will be overwritten.
Returns string.Empty if the saving was successful.
<p>
<code>"FileExists"</code> - if overwriting is not allowed and the file exists.
<code>"MessageCannotWriteToFolder"</code> - if there are not enough permissions to write the file.
</p>
Stores an image, generates key that corresponds to the stored image, and returns the key.
string Store(EditableImage image)
The EditableImage object to store.
Returns:The key that corresponds to the stored editable image.