Class
MemoryCache

A generic map cache storage.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

cs-api-definition
public class MemoryCache : DependencyObject, ICacheStorage

Inheritance: objectMemoryCache

Derived Classes: FileCacheBase

Implements: ICacheStorage

Constructors

MemoryCache()

Initializes a new instance of the MemoryCache class.

Declaration

cs-api-definition
public MemoryCache()

Fields

MemoryMaxSizeProperty

Identifies the MemoryMaxSize dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty MemoryMaxSizeProperty

Field Value

DependencyProperty

Properties

MemoryMaxSize

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

Declaration

cs-api-definition
public long MemoryMaxSize { get; set; }

Property Value

long

Methods

AddToCacheRecords(CacheRecord)

Adds cache record to the memory cache container.

Declaration

cs-api-definition
protected void AddToCacheRecords(MemoryCache.CacheRecord cacheRecord)

Parameters

cacheRecord

MemoryCache.CacheRecord

Cache record instance.

GetCacheRecord(string)

Gets the CacheRecord.

Declaration

cs-api-definition
protected MemoryCache.CacheRecord GetCacheRecord(string fileName)

Parameters

fileName

string

File name.

Returns

MemoryCache.CacheRecord

CacheRecord.

GetTile(string)

Reads tile.

Declaration

cs-api-definition
protected byte[] GetTile(string fileName)

Parameters

fileName

string

File name.

Returns

byte[]

Byte array of tile image.

Load(string)

Loads the file from the memory cache.

Declaration

cs-api-definition
public virtual Stream Load(string fileName)

Parameters

fileName

string

File name.

Returns

Stream

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

Implements ICacheStorage.Load(string)

LoadAsync(string, Action<byte[]>)

Loaded file from a cache.

Declaration

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

Parameters

fileName

string

File name.

callback

Action<byte[]>

TileAvailable event arguments.

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

Save(string, DateTime, byte[])

Saves the file to the memory.

Declaration

cs-api-definition
public virtual void Save(string fileName, DateTime expirationDate, byte[] tile)

Parameters

fileName

string

File name.

expirationDate

DateTime

Expiration date.

tile

byte[]

Byte array which is saved to the file.

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