mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Replaced ImageCacheItem by Tuple
This commit is contained in:
parent
2709f90cdc
commit
77c2169999
14 changed files with 60 additions and 122 deletions
|
|
@ -9,7 +9,7 @@ namespace MapControl.Caching
|
|||
{
|
||||
public partial class FileDbCache : IImageCache
|
||||
{
|
||||
public Task<ImageCacheItem> GetAsync(string key)
|
||||
public Task<Tuple<byte[], DateTime>> GetAsync(string key)
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
|
|
@ -20,17 +20,13 @@ namespace MapControl.Caching
|
|||
return null;
|
||||
}
|
||||
|
||||
return new ImageCacheItem
|
||||
{
|
||||
Buffer = (byte[])record[0],
|
||||
Expiration = (DateTime)record[1]
|
||||
};
|
||||
return Tuple.Create((byte[])record[0], (DateTime)record[1]);
|
||||
});
|
||||
}
|
||||
|
||||
public Task SetAsync(string key, ImageCacheItem cacheItem)
|
||||
public Task SetAsync(string key, byte[] buffer, DateTime expiration)
|
||||
{
|
||||
return Task.Run(() => AddOrUpdateRecord(key, cacheItem.Buffer, cacheItem.Expiration));
|
||||
return Task.Run(() => AddOrUpdateRecord(key, buffer, expiration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue