New to Telerik UI for WinFormsStart a free 30-day trial

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:

C#
public class LocalFileCacheProvider : IMapCacheProvider

Inheritance: objectLocalFileCacheProvider

Implements: IMapCacheProvider

Constructors

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

C#
public LocalFileCacheProvider(string cacheDirectoryPath)
Parameters:cacheDirectoryPathstring

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

Properties

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

C#
public string CacheDirectoryPath { get; set; }

Methods

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

C#
protected virtual void AsyncFileReadComplete(IAsyncResult asyncResult)
Parameters:asyncResultIAsyncResult

The IAsyncResult representing the status of the asynchronous operation.

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

C#
public Stream Load(string key)
Parameters:keystring

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)

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.

C#
public void LoadAsync(string key, Action<string, byte[]> callback)
Parameters:keystring

The cache key identifying the cached item to load.

callbackAction<string, byte[]>

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

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

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

C#
public void Save(string key, DateTime expirationDate, byte[] content)
Parameters:keystring

The cache key identifying the item to save.

expirationDateDateTime

The expiration date for the cached item.

contentbyte[]

The byte array containing the data to cache.

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