TileCache¶
Namespace: ThinkGeo.Core
This is the base class for TileCache system.
public abstract class TileCache
Inheritance Object → TileCache
Remarks:
TileCahce system is very efficient in improving the performance of application, especially when large data or remote server images are included.
Properties¶
TileAccessMode¶
Gets or sets the Mode for the TileCache access the tiles. The Default value is ReadAddDelete
public TileAccessMode TileAccessMode { get; set; }
Property Value¶
Remarks:
If you want it to take effect, you need set the Read property false.
CacheId¶
Gets or sets the id of the TileCache.
public string CacheId { get; set; }
Property Value¶
ExpirationTime¶
public TimeSpan ExpirationTime { get; set; }
Property Value¶
Methods¶
OnGottenCacheTile(GottenCacheImageBitmapTileCacheEventArgs)¶
protected void OnGottenCacheTile(GottenCacheImageBitmapTileCacheEventArgs e)
Parameters¶
e
GottenCacheImageBitmapTileCacheEventArgs
OnGettingCacheTile(GettingCacheImageBitmapTileCacheEventArgs)¶
protected void OnGettingCacheTile(GettingCacheImageBitmapTileCacheEventArgs e)
Parameters¶
e
GettingCacheImageBitmapTileCacheEventArgs
GetTile(Int32, Int64, Int64)¶
This method returns the BitmapTile corresponding to passed in row and column.
public Tile GetTile(int zoom, long column, long row)
Parameters¶
zoom
Int32
column
Int64
The target column for the tileView to fetch.
row
Int64
The target row for the tileView to fetch.
Returns¶
Tile
Returns the BitmapTile corresponding to the passed in row and column.
GetTileAsync(Int32, Int64, Int64, CancellationToken)¶
This method returns the BitmapTile corresponding to passed in row and column.
public Task<Tile> GetTileAsync(int zoom, long column, long row, CancellationToken cancellationToken)
Parameters¶
zoom
Int32
column
Int64
The target column for the tileView to fetch.
row
Int64
The target row for the tileView to fetch.
cancellationToken
CancellationToken
Returns¶
Task<Tile>
Returns the BitmapTile corresponding to the passed in row and column.
SaveTile(Tile)¶
This method will save the target tileView passed in.
public void SaveTile(Tile tile)
Parameters¶
tile
Tile
The target tileView to be saved.
Exceptions¶
ArgumentNullException
If you pass a null as the target tileView, we will throw an ArgumentNullException.
Remarks:
This method will not take effect when the Read is set to true.
SaveTileAsync(Tile, CancellationToken)¶
public Task SaveTileAsync(Tile tile, CancellationToken cancellationToken)
Parameters¶
tile
Tile
cancellationToken
CancellationToken
Returns¶
DeleteTile(Tile)¶
This method will delete the target tileView passed in.
public void DeleteTile(Tile tile)
Parameters¶
tile
Tile
The target tileView to be deleted.
Exceptions¶
ArgumentNullException
If you pass a null as the target tileView, we will throw an ArgumentNullException.
Remarks:
This method will not take effect when the Read is set to true.
ClearCache()¶
This method will clear all the tiles in the tileCache.
public void ClearCache()
Remarks:
This method will not take effect when the Read is set to true.
ClearCacheCore()¶
This abstract method will clear all the tiles in the tileCache, for each sub TileCache class must implement this method.
protected abstract void ClearCacheCore()
Remarks:
This method will not take effect when the Read is set to true.
SaveTileCore(Tile)¶
This abstract method will save the target tileView passed in, for each sub TileCache class must implement this method.
protected abstract void SaveTileCore(Tile tile)
Parameters¶
tile
Tile
The target tileView to be saved.
Remarks:
This method will not take effect when the Read is set to true.
DeleteTileCore(Tile)¶
This abstract method will delete the target tileView passed in, for each sub TileCache class must implement this method.
protected abstract void DeleteTileCore(Tile tile)
Parameters¶
tile
Tile
The target tileView to be deleted.
Remarks:
This method will not take effect when the Read is set to true.
SaveTileAsyncCore(Tile, CancellationToken)¶
protected Task SaveTileAsyncCore(Tile tile, CancellationToken cancellationToken)
Parameters¶
tile
Tile
cancellationToken
CancellationToken
Returns¶
GetTileAsyncCore(Int32, Int64, Int64, CancellationToken)¶
protected Task<Tile> GetTileAsyncCore(int zoom, long column, long row, CancellationToken cancellationToken)
Parameters¶
zoom
Int32
column
Int64
row
Int64
cancellationToken
CancellationToken
Returns¶
GetTileCore(Int32, Int64, Int64)¶
This abstract method returns the BitmapTile corresponding to passed in row and column. Each concrete TileCache need to implement this logic to get tileView from a row and column.
protected abstract Tile GetTileCore(int zoom, long column, long row)
Parameters¶
zoom
Int32
column
Int64
The target column for the tileView to fetch.
row
Int64
The target row for the tileView to fetch.
Returns¶
Tile
Returns the BitmapTile corresponding to the passed in row and column.
Events¶
GottenCacheTile¶
public event EventHandler<GottenCacheImageBitmapTileCacheEventArgs> GottenCacheTile;
GettingCacheTile¶
public event EventHandler<GettingCacheImageBitmapTileCacheEventArgs> GettingCacheTile;