Version 7.0: WinUI

This commit is contained in:
Clemens 2021-11-17 23:46:48 +01:00
parent 0820a77dd5
commit 63da15f6a5
32 changed files with 57 additions and 149 deletions

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2021 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("6.1.0")]
[assembly: AssemblyFileVersion("6.1.0")]
[assembly: AssemblyVersion("7.0.0")]
[assembly: AssemblyFileVersion("7.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -1,50 +0,0 @@
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// © 2021 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace MapControl.Caching
{
public partial class SQLiteCache : IImageCache
{
public async Task<Tuple<byte[], DateTime>> GetAsync(string key)
{
try
{
using (var command = GetItemCommand(key))
{
var reader = await command.ExecuteReaderAsync();
if (await reader.ReadAsync())
{
return Tuple.Create((byte[])reader["buffer"], new DateTime((long)reader["expiration"]));
}
}
}
catch (Exception ex)
{
Debug.WriteLine($"SQLiteCache.GetAsync({key}): {ex.Message}");
}
return null;
}
public async Task SetAsync(string key, byte[] buffer, DateTime expiration)
{
try
{
using (var command = SetItemCommand(key, buffer, expiration))
{
await command.ExecuteNonQueryAsync();
}
}
catch (Exception ex)
{
Debug.WriteLine($"SQLiteCache.SetAsync({key}): {ex.Message}");
}
}
}
}

View file

@ -23,7 +23,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;WINDOWS_UWP</DefineConstants>
<DefineConstants>DEBUG;UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@ -32,7 +32,7 @@
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>WINDOWS_UWP</DefineConstants>
<DefineConstants>UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@ -43,8 +43,10 @@
<Compile Include="..\Shared\SQLiteCache.cs">
<Link>SQLiteCache.cs</Link>
</Compile>
<Compile Include="..\WinUI\SQLiteCache.WinUI.cs">
<Link>SQLiteCache.WinUI.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SQLiteCache.UWP.cs" />
<EmbeddedResource Include="Properties\SQLiteCache.UWP.rd.xml" />
</ItemGroup>
<ItemGroup>