New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

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:

C#
public interface ICacheImageProvider

Derived Classes: CacheImageProvider

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.

C#
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.

C#
ImageStorage Storage { get; set; }

Methods

Clears all images currently saved by the provider.

C#
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.

C#
void ClearImages(string imageKey)
Parameters:imageKeystring

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.

C#
Image LoadImage(string imageUrl, string physicalPath, HttpContext context)
Parameters:imageUrlstring

The path to the image to load.

physicalPathstring

The physical path to the image to load.

contextHttpContext

The HttpContext to which the application belongs.

Returns:

Image

Returns the Image object loaded from the specified location.

Retrieves an EditableImage from the provider.

C#
EditableImage Retrieve(string key)
Parameters:keystring

The key that corresponds to the editable image.

Returns:

EditableImage

An EditableImage object that corresponds to the key passed.

Saves the image in persistent storage location.

C#
string SaveImage(EditableImage editableImage, string physicalPath, string imageUrl, bool overwrite)
Parameters:editableImageEditableImage

The EditableImage object to store.

physicalPathstring

The physical path (including the file name) where the image will be stored.

imageUrlstring

The 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.

overwritebool

Bool value indicating whether or not the existing image (if it exists) will be overwritten.

string

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.

C#
string Store(EditableImage image)
Parameters:imageEditableImage

The EditableImage object to store.

Returns:

string

The key that corresponds to the stored editable image.