C# Class MapAround.Caching.FileTileCacheAccessor

Represents an object that provides an access to the tile cache storing into files.
Inheritance: ITileCacheAccessor
Show file Open project: gkrsu/maparound.core Class Usage Examples

Public Methods

Method Description
ExtractTileBytes ( string layer, BoundingRectangle area, string key, string contentType ) : byte[]

Extracts a binary representation of tile from cache.

FileTileCacheAccessor ( string path ) : System.Text

Initializes a new instance of the MapAround.Caching.FileTileCacheAccessor

GetCacheFile ( string layer, BoundingRectangle area, string key, string contentType ) : string

Gets the physical location of the file

Invalidate ( BoundingRectangle area ) : void

Invalidate cache given area.

Invalidate ( string layer, BoundingRectangle area ) : void

Invalidate cache given area.

SaveTileBytes ( string layer, BoundingRectangle area, string key, byte tile, string contentType ) : void

Saves a binary representation of an image into cache.

Protected Methods

Method Description
FileNameFromCacheKey ( string cacheKey, string contentType ) : string

Gets a file name (excluding directory name) by the cache access key.

GetAreaDir ( BoundingRectangle rectangle ) : string

Gets area

GetLayerDir ( string Layer ) : string

Gets layer directory

Private Methods

Method Description
CheckIntersect ( string path, double layerValue, string param ) : IEnumerable

Helps to find the intersection.

DeleteEmptyDirectory ( string path ) : void

Deletes an empty directory.

Lock ( ) : void
Unlock ( ) : void

Method Details

ExtractTileBytes() public method

Extracts a binary representation of tile from cache.
public ExtractTileBytes ( string layer, BoundingRectangle area, string key, string contentType ) : byte[]
layer string
area BoundingRectangle
key string Access key
contentType string
return byte[]

FileNameFromCacheKey() protected method

Gets a file name (excluding directory name) by the cache access key.
protected FileNameFromCacheKey ( string cacheKey, string contentType ) : string
cacheKey string A cache access key
contentType string
return string

FileTileCacheAccessor() public method

Initializes a new instance of the MapAround.Caching.FileTileCacheAccessor
public FileTileCacheAccessor ( string path ) : System.Text
path string The path to the files of cache
return System.Text

GetAreaDir() protected method

Gets area
protected GetAreaDir ( BoundingRectangle rectangle ) : string
rectangle BoundingRectangle
return string

GetCacheFile() public method

Gets the physical location of the file
public GetCacheFile ( string layer, BoundingRectangle area, string key, string contentType ) : string
layer string
area BoundingRectangle
key string
contentType string
return string

GetLayerDir() protected method

Gets layer directory
protected GetLayerDir ( string Layer ) : string
Layer string
return string

Invalidate() public method

Invalidate cache given area.
public Invalidate ( BoundingRectangle area ) : void
area BoundingRectangle
return void

Invalidate() public method

Invalidate cache given area.
public Invalidate ( string layer, BoundingRectangle area ) : void
layer string Layer
area BoundingRectangle Given area
return void

SaveTileBytes() public method

Saves a binary representation of an image into cache.
public SaveTileBytes ( string layer, BoundingRectangle area, string key, byte tile, string contentType ) : void
layer string
area BoundingRectangle
key string Access key
tile byte Byte array that contains a binary representation of a tile image
contentType string
return void