Class LocalFileCacheProvider
Provides local file system-based caching for map tiles, implementing the IMapCacheProvider interface to store and retrieve map data from disk.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.RadMap.dll
Syntax
public class LocalFileCacheProvider : 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
public LocalFileCacheProvider(string cacheDirectoryPath)
Parameters
|
System.String
cacheDirectoryPath
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
public string CacheDirectoryPath { get; set; }
Property Value
|
System.String
|
Methods
AsyncFileReadComplete(IAsyncResult)
Handles the completion of asynchronous file read operations, closing resources and invoking the callback with the loaded data.
Declaration
protected virtual void AsyncFileReadComplete(IAsyncResult asyncResult)
Parameters
|
System.IAsyncResult
asyncResult
The System.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
public Stream Load(string key)
Parameters
|
System.String
key
The cache key identifying the cached item to load. |
Returns
|
System.IO.Stream
A System.IO.Stream containing the cached data, or null if not found or expired. |
Implements
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
public void LoadAsync(string key, Action<string, byte[]> callback)
Parameters
|
System.String
key
The cache key identifying the cached item to load. |
|
System.Action<System.String, System.Byte[]>
callback
The callback action to invoke with the key and loaded data when the operation completes. |
Implements
Save(String, DateTime, Byte[])
Saves data to the cache with the specified key and expiration date, creating or overwriting the file as necessary.
Declaration
public void Save(string key, DateTime expirationDate, byte[] content)
Parameters
|
System.String
key
The cache key identifying the item to save. |
|
System.DateTime
expirationDate
The expiration date for the cached item. |
|
System.Byte[]
content
The byte array containing the data to cache. |