mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
Unified ImageFileCache implementations
This commit is contained in:
parent
8d575f01cf
commit
e98f5b9bff
2 changed files with 10 additions and 11 deletions
|
|
@ -160,11 +160,10 @@ namespace MapControl.Caching
|
|||
|
||||
memoryCache.Set(key, imageCacheItem, policy);
|
||||
|
||||
string path;
|
||||
var buffer = imageCacheItem.Buffer;
|
||||
var path = GetPath(key);
|
||||
|
||||
if (imageCacheItem.Buffer != null &&
|
||||
imageCacheItem.Buffer.Length > 0 &&
|
||||
(path = GetPath(key)) != null)
|
||||
if (buffer != null && buffer.Length > 0 && path != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -172,7 +171,7 @@ namespace MapControl.Caching
|
|||
|
||||
using (var stream = File.Create(path))
|
||||
{
|
||||
stream.Write(imageCacheItem.Buffer, 0, imageCacheItem.Buffer.Length);
|
||||
stream.Write(buffer, 0, buffer.Length);
|
||||
stream.Write(Encoding.ASCII.GetBytes(expiresTag), 0, 8);
|
||||
stream.Write(BitConverter.GetBytes(imageCacheItem.Expiration.Ticks), 0, 8);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue