Class
LocalFileCacheProvider

Provides local file system-based caching for map tiles, implementing the IMapCacheProvider interface to store and retrieve map data from disk.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

cs-api-definition
public class LocalFileCacheProvider : IMapCacheProvider

Inheritance: objectLocalFileCacheProvider

Implements: IMapCacheProvider

Constructors

LocalFileCacheProvider(string)

Initializes a new instance of the LocalFileCacheProvider class with the specified cache directory, creating the directory if it doesn't exist.

Declaration

cs-api-definition
public LocalFileCacheProvider(string cacheDirectoryPath)

Parameters

cacheDirectoryPath

string

The file system path where cached map tiles will be stored.

Properties

CacheDirectoryPath

Gets or sets the directory path where cached map tiles are stored, automatically creating the directory if it doesn't exist.

Declaration

cs-api-definition
public string CacheDirectoryPath { get; set; }

Property Value

string

Methods

AsyncFileReadComplete(IAsyncResult)

Handles the completion of asynchronous file read operations, closing resources and invoking the callback with the loaded data.

Declaration

cs-api-definition
protected virtual void AsyncFileReadComplete(IAsyncResult asyncResult)

Parameters

asyncResult

IAsyncResult

The IAsyncResult representing the status of the asynchronous operation.

Load(string)

Synchronously loads cached data from the file system using the specified key, checking expiration and returning null if expired or not found.

Declaration

cs-api-definition
public Stream Load(string key)

Parameters

key

string

The cache key identifying the cached item to load.

Returns

Stream

A Stream containing the cached data, or null if not found or expired.

Implements IMapCacheProvider.Load(string)

LoadAsync(string, Action<string, byte[]>)

Asynchronously loads cached data from the file system using the specified key, invoking the callback with the results or null if not found or expired.

Declaration

cs-api-definition
public void LoadAsync(string key, Action<string, byte[]> callback)

Parameters

key

string

The cache key identifying the cached item to load.

callback

Action<string, byte[]>

The callback action to invoke with the key and loaded data when the operation completes.

Implements IMapCacheProvider.LoadAsync(string, Action<string, byte[]>)

Save(string, DateTime, byte[])

Saves data to the cache with the specified key and expiration date, creating or overwriting the file as necessary.

Declaration

cs-api-definition
public void Save(string key, DateTime expirationDate, byte[] content)

Parameters

key

string

The cache key identifying the item to save.

expirationDate

DateTime

The expiration date for the cached item.

content

byte[]

The byte array containing the data to cache.

Implements IMapCacheProvider.Save(string, DateTime, byte[])