mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Unified ImageCacheItem
This commit is contained in:
parent
e138cb83ab
commit
2709f90cdc
12 changed files with 133 additions and 176 deletions
|
|
@ -3,9 +3,7 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Storage.Streams;
|
||||
|
||||
namespace MapControl.Caching
|
||||
{
|
||||
|
|
@ -24,15 +22,15 @@ namespace MapControl.Caching
|
|||
|
||||
return new ImageCacheItem
|
||||
{
|
||||
Buffer = ((byte[])record[0]).AsBuffer(),
|
||||
Buffer = (byte[])record[0],
|
||||
Expiration = (DateTime)record[1]
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public Task SetAsync(string key, IBuffer buffer, DateTime expiration)
|
||||
public Task SetAsync(string key, ImageCacheItem cacheItem)
|
||||
{
|
||||
return Task.Run(() => AddOrUpdateRecord(key, buffer?.ToArray(), expiration));
|
||||
return Task.Run(() => AddOrUpdateRecord(key, cacheItem.Buffer, cacheItem.Expiration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue