Skip to content

FileTileCache

Namespace: ThinkGeo.Core

Represents the FileTileCache class.

public class FileTileCache

Inheritance objectFileTileCache

Properties

FileExtension

Gets or sets the FileExtension.

public string FileExtension { get; set; }

Property Value

string

CacheDirectory

Gets or sets the CacheDirectory.

public string CacheDirectory { get; set; }

Property Value

string

ExpirationTime

Gets or sets the ExpirationTime.

public TimeSpan ExpirationTime { get; set; }

Property Value

TimeSpan

Constructors

FileTileCache()

Initializes a new instance of the FileTileCache class.

public FileTileCache()

FileTileCache(string)

Initializes a new instance of the FileTileCache class.

public FileTileCache(string cacheDirectory)

Parameters

cacheDirectory string

Methods

OnGettingTile(GettingTileTileCacheEventArgs)

Performs on getting tile.

protected void OnGettingTile(GettingTileTileCacheEventArgs e)

Parameters

e GettingTileTileCacheEventArgs
The e.

Returns

void

OnGottenTile(GottenTileTileCacheEventArgs)

Performs on gotten tile.

protected void OnGottenTile(GottenTileTileCacheEventArgs e)

Parameters

e GottenTileTileCacheEventArgs
The e.

Returns

void

OnSavingTile(SavingTileTileCacheEventArgs)

Performs on saving tile.

protected void OnSavingTile(SavingTileTileCacheEventArgs e)

Parameters

e SavingTileTileCacheEventArgs
The e.

Returns

void

OnSavedTile(SavedTileTileCacheEventArgs)

Performs on saved tile.

protected void OnSavedTile(SavedTileTileCacheEventArgs e)

Parameters

e SavedTileTileCacheEventArgs
The e.

Returns

void

GetTileAsync(int, long, long, CancellationToken)

Returns tile async for the specified parameters.

public Task<Tile> GetTileAsync(int zoom, long x, long y, CancellationToken cancellationToken)

Parameters

zoom int
The zoom.

x long
The x-coordinate, in pixels.

y long
The y-coordinate, in pixels.

cancellationToken CancellationToken
A cancellation or authentication token, depending on context.

Returns

Task<Tile>
A task that represents the asynchronous operation and provides the result.

GetTileAsync(int, long, long, string, CancellationToken)

Returns tile async for the specified parameters.

public Task<Tile> GetTileAsync(int zoom, long x, long y, string tileSource, CancellationToken cancellationToken)

Parameters

zoom int
The zoom.

x long
The x-coordinate, in pixels.

y long
The y-coordinate, in pixels.

tileSource string
The tile source.

cancellationToken CancellationToken
A cancellation or authentication token, depending on context.

Returns

Task<Tile>
A task that represents the asynchronous operation and provides the result.

GetTileAsyncCore(int, long, long, string, CancellationToken)

Returns tile async for the specified parameters.

protected Task<Tile> GetTileAsyncCore(int zoom, long x, long y, string tileSource, CancellationToken cancellationToken)

Parameters

zoom int
The zoom.

x long
The x-coordinate, in pixels.

y long
The y-coordinate, in pixels.

tileSource string
The tile source.

cancellationToken CancellationToken
A cancellation or authentication token, depending on context.

Returns

Task<Tile>
A task that represents the asynchronous operation and provides the result.

SaveTileAsync(Tile, CancellationToken)

Saves the current object to the specified destination.

public Task SaveTileAsync(Tile tile, CancellationToken cancellationToken)

Parameters

tile Tile
The tile.

cancellationToken CancellationToken
A cancellation or authentication token, depending on context.

Returns

Task
A task that represents the asynchronous operation.

SaveTileAsync(Tile, string, CancellationToken)

Saves the current object to the specified destination.

public Task SaveTileAsync(Tile tile, string tileSource, CancellationToken cancellationToken)

Parameters

tile Tile
The tile.

tileSource string
The tile source.

cancellationToken CancellationToken
A cancellation or authentication token, depending on context.

Returns

Task
A task that represents the asynchronous operation.

SaveTileAsyncCore(Tile, string, CancellationToken)

Provides the overridable implementation that saves the current object to the specified destination.

protected Task SaveTileAsyncCore(Tile tile, string tileSource, CancellationToken cancellationToken)

Parameters

tile Tile
The tile.

tileSource string
The tile source.

cancellationToken CancellationToken
A cancellation or authentication token, depending on context.

Returns

Task
A task that represents the asynchronous operation.

DeleteTile(Tile)

Performs delete tile.

public void DeleteTile(Tile tile)

Parameters

tile Tile
The tile.

Returns

void

DeleteTile(Tile, string)

Performs delete tile.

public void DeleteTile(Tile tile, string tileSource)

Parameters

tile Tile
The tile.

tileSource string
The tile source.

Returns

void

DeleteTileCore(Tile, string)

Provides the overridable implementation that performs delete tile.

protected void DeleteTileCore(Tile tile, string tileSource)

Parameters

tile Tile
The tile.

tileSource string
The tile source.

Returns

void

ClearCache()

Clears all cached tiles by deleting the cache directory.

public void ClearCache()

Returns

void

ClearCacheCore()

Provides the overridable implementation that performs clear cache.

protected void ClearCacheCore()

Returns

void

ToSafeShortDirectoryName(string, int)

Generates a filesystem-safe short directory name for the supplied input.

public static string ToSafeShortDirectoryName(string input, int maxLength)

Parameters

input string
The input string to normalize.

maxLength int
The maximum length for the generated name.

Returns

string
A safe directory name derived from the input.

Events

GettingTile

Occurs when the GettingTile event is raised.

public event EventHandler<GettingTileTileCacheEventArgs> GettingTile;

GottenTile

Occurs when the GottenTile event is raised.

public event EventHandler<GottenTileTileCacheEventArgs> GottenTile;

SavingTile

Occurs when the SavingTile event is raised.

public event EventHandler<SavingTileTileCacheEventArgs> SavingTile;

SavedTile

Occurs when the SavedTile event is raised.

public event EventHandler<SavedTileTileCacheEventArgs> SavedTile;