Class MemoryCache
A generic map cache storage.
Inheritance
Namespace: Telerik.Windows.Controls.Map
Assembly: Telerik.Windows.Controls.DataVisualization.dll
Syntax
public class MemoryCache : DependencyObject, ICacheStorage
Constructors
MemoryCache()
Initializes a new instance of the MemoryCache class.
Declaration
public MemoryCache()
Fields
MemoryMaxSizeProperty
Identifies the MemoryMaxSize dependency property.
Declaration
public static readonly DependencyProperty MemoryMaxSizeProperty
Field Value
System.Windows.DependencyProperty
|
Properties
MemoryMaxSize
Gets or sets the maximal memory cache size for a storage. This is a dependency property.
Declaration
public long MemoryMaxSize { get; set; }
Property Value
System.Int64
|
Methods
AddToCacheRecords(MemoryCache.CacheRecord)
Adds cache record to the memory cache container.
Declaration
protected void AddToCacheRecords(MemoryCache.CacheRecord cacheRecord)
Parameters
MemoryCache.CacheRecord
cacheRecord
Cache record instance. |
GetCacheRecord(String)
Gets the CacheRecord.
Declaration
protected MemoryCache.CacheRecord GetCacheRecord(string fileName)
Parameters
System.String
fileName
File name. |
Returns
MemoryCache.CacheRecord
CacheRecord. |
GetTile(String)
Reads tile.
Declaration
protected byte[] GetTile(string fileName)
Parameters
System.String
fileName
File name. |
Returns
System.Byte[]
Byte array of tile image. |
Load(String)
Loads the file from the memory cache.
Declaration
public virtual Stream Load(string fileName)
Parameters
System.String
fileName
File name. |
Returns
System.IO.Stream
Stream if the file exists and does not expired or null. |
Implements
LoadAsync(String, Action<Byte[]>)
Loaded file from a cache.
Declaration
public virtual void LoadAsync(string fileName, Action<byte[]> callback)
Parameters
System.String
fileName
File name. |
System.Action<System.Byte[]>
callback
TileAvailable event arguments. |
Implements
Save(String, DateTime, Byte[])
Saves the file to the memory.
Declaration
public virtual void Save(string fileName, DateTime expirationDate, byte[] tile)
Parameters
System.String
fileName
File name. |
System.DateTime
expirationDate
Expiration date. |
System.Byte[]
tile
Byte array which is saved to the file. |