Fix UWP build

This commit is contained in:
Morten Nielsen 2024-07-02 09:21:26 -07:00
parent 4a70acc60b
commit ebcdb6ddae
5 changed files with 15 additions and 15 deletions

View file

@ -12,7 +12,7 @@
// * limitations under the License.
// ******************************************************************************
#if NETFX_CORE
#if WINDOWS_UWP
using System;
using System.Collections.Generic;
using System.Linq;

View file

@ -26,7 +26,7 @@ namespace NmeaParser
/// </summary>
public class NmeaFileDevice : BufferedStreamDevice
{
#if NETFX_CORE
#if WINDOWS_UWP
private Windows.Storage.IStorageFile? m_storageFile;
#endif
private string m_filename;
@ -40,7 +40,7 @@ namespace NmeaParser
{
}
#if NETFX_CORE
#if WINDOWS_UWP
/// <summary>
/// Initializes a new instance of the <see cref="NmeaFileDevice"/> class.
/// </summary>
@ -59,7 +59,7 @@ namespace NmeaParser
m_filename = fileName;
}
#if NETFX_CORE
#if WINDOWS_UWP
/// <summary>
/// Initializes a new instance of the <see cref="NmeaFileDevice"/> class.
/// </summary>
@ -89,7 +89,7 @@ namespace NmeaParser
protected override Task<Stream> GetStreamAsync()
{
#if NETFX_CORE
#if WINDOWS_UWP
if (m_storageFile != null)
return m_storageFile.OpenStreamForReadAsync();
#endif

View file

@ -18,7 +18,7 @@
<PackageProjectUrl>https://dotmorten.github.io/NmeaParser/</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotMorten/NmeaParser</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<Copyright>Copyright © Morten Nielsen 2015-2023</Copyright>
<Copyright>Copyright © Morten Nielsen 2015-$([System.DateTime]::Now.ToString('yyyy'))</Copyright>
<OutputPath>$(MSBuildThisFileDirectory)..\..\artifacts\NmeaParser\$(Configuration)</OutputPath>
<PackageOutputPath>..\..\artifacts\NuGet\$(Configuration)\</PackageOutputPath>
<PackageReleaseNotes></PackageReleaseNotes>
@ -34,7 +34,7 @@
<PackageIconUrl />
<CheckEolWorkloads>false</CheckEolWorkloads>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<_SdkIgnoreMSBuildCoreWarning>true</_SdkIgnoreMSBuildCoreWarning>
<_SdkIgnoreMSBuildCoreWarning>true</_SdkIgnoreMSBuildCoreWarning>
</PropertyGroup>
<PropertyGroup Label="PackageValidationSettings">
@ -91,11 +91,11 @@
<NoWarn>$(NoWarn);VSX1000</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.19041'">
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.19041'">
<EmbeddedResource Include="**\*.rd.xml" />
</ItemGroup>

View file

@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.ComponentModel;
#if NETFX_CORE
#if WINDOWS_UWP
using Windows.UI.Xaml;
#else
using System.Windows.Threading;
@ -28,7 +28,7 @@ namespace SampleApp.WinDesktop
}
#if NETFX_CORE
#if WINDOWS_UWP
void m_timer_Tick(object sender, object e)
#else
void m_timer_Tick(object sender, EventArgs e)

View file

@ -31,14 +31,14 @@ namespace NmeaParser.Tests
{
[TestMethod]
public
#if NETFX_CORE
#if WINDOWS_UWP
async Task
#else
void
#endif
ParseNmeaFile()
{
#if NETFX_CORE
#if WINDOWS_UWP
var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///NmeaSampleData.txt"));
System.IO.StreamReader reader = new System.IO.StreamReader(await file.OpenStreamForReadAsync());
#else
@ -64,14 +64,14 @@ namespace NmeaParser.Tests
}
[TestMethod]
public
#if NETFX_CORE
#if WINDOWS_UWP
async Task
#else
void
#endif
ParseTrimbleR2NmeaFile()
{
#if NETFX_CORE
#if WINDOWS_UWP
var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///TrimbleR2SampleData.txt"));
System.IO.StreamReader reader = new System.IO.StreamReader(await file.OpenStreamForReadAsync());
#else