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

A generic map cache storage.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

C#
public class MemoryCache : DependencyObject, ICacheStorage

Inheritance: objectMemoryCache

Derived Classes: FileCacheBase

Implements: ICacheStorage

Constructors

Initializes a new instance of the MemoryCache class.

C#
public MemoryCache()

Fields

MemoryMaxSizeProperty

DependencyProperty

Identifies the MemoryMaxSize dependency property.

C#
public static readonly DependencyProperty MemoryMaxSizeProperty

Properties

Gets or sets the maximal memory cache size for a storage. This is a dependency property.

C#
public long MemoryMaxSize { get; set; }

Methods

Adds cache record to the memory cache container.

C#
protected void AddToCacheRecords(MemoryCache.CacheRecord cacheRecord)
Parameters:cacheRecordMemoryCache.CacheRecord

Cache record instance.

Gets the CacheRecord.

C#
protected MemoryCache.CacheRecord GetCacheRecord(string fileName)
Parameters:fileNamestring

File name.

Returns:

MemoryCache.CacheRecord

CacheRecord.

Reads tile.

C#
protected byte[] GetTile(string fileName)
Parameters:fileNamestring

File name.

Returns:

byte[]

Byte array of tile image.

Loads the file from the memory cache.

C#
public virtual Stream Load(string fileName)
Parameters:fileNamestring

File name.

Returns:

Stream

Stream if the file exists and does not expired or null.

Implements: ICacheStorage.Load(string)

Loaded file from a cache.

C#
public virtual void LoadAsync(string fileName, Action<byte[]> callback)
Parameters:fileNamestring

File name.

callbackAction<byte[]>

TileAvailable event arguments.

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

Saves the file to the memory.

C#
public virtual void Save(string fileName, DateTime expirationDate, byte[] tile)
Parameters:fileNamestring

File name.

expirationDateDateTime

Expiration date.

tilebyte[]

Byte array which is saved to the file.

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