From fd6d4a80a33011929fcd322a82e19319128819f0 Mon Sep 17 00:00:00 2001 From: "Joshua \"Yoshi\" Askharoun" Date: Sun, 7 Dec 2025 19:07:10 -0600 Subject: [PATCH] Target net472, fix WinRT-related conditionals --- Directory.Build.props | 2 +- ZuneHost.Wpf/MainWindow.xaml.cs | 4 ++-- ZuneHost.Wpf/ZuneHost.Wpf.csproj | 2 +- ZuneHost/ZuneHost.csproj | 2 +- ZuneImpl/ZuneImpl.csproj | 2 +- ZuneShell/Microsoft/WinRT/ApiInformation.cs | 2 +- ZuneShell/ZuneUI/TransportControls/TransportControls.cs | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index bb37660..4e93813 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,7 +10,7 @@ $(DefineConstants);OPENZUNE - netstandard2.0;net461;net6.0;net6.0-windows + net472;net6.0;net6.0-windows x64;x86 False diff --git a/ZuneHost.Wpf/MainWindow.xaml.cs b/ZuneHost.Wpf/MainWindow.xaml.cs index b66d011..a9c2e3b 100644 --- a/ZuneHost.Wpf/MainWindow.xaml.cs +++ b/ZuneHost.Wpf/MainWindow.xaml.cs @@ -36,7 +36,7 @@ namespace ZuneHost.Wpf var dbgconstrArg = args.FirstOrDefault(a => a.StartsWith(ARG_DBGCONSTR)); if (dbgconstrArg is not null) { - connectionString = dbgconstrArg[ARG_DBGCONSTR.Length..].Trim(); + connectionString = dbgconstrArg.Substring(ARG_DBGCONSTR.Length).Trim(); } string strArgs = string.Join(" ", args.ToArray()); @@ -96,7 +96,7 @@ namespace ZuneHost.Wpf { IrisApp.Initialized += delegate { - UIXControls.Helpers.AddResourceRedirect("res://ZuneShellResources!", "clr-res://ZuneShell!"); + IrisApp.AddResourceRedirect("res://ZuneShellResources!", "clr-res://ZuneShell!"); UIXControls.Helpers.AddUIXControlsClrRedirect(); }; diff --git a/ZuneHost.Wpf/ZuneHost.Wpf.csproj b/ZuneHost.Wpf/ZuneHost.Wpf.csproj index a79130b..769eb39 100644 --- a/ZuneHost.Wpf/ZuneHost.Wpf.csproj +++ b/ZuneHost.Wpf/ZuneHost.Wpf.csproj @@ -2,7 +2,7 @@ WinExe - net6.0-windows10.0.22000;net461 + net6.0-windows10.0.22000;net472 11.0 true Assets\ZuneFluentGem.ico diff --git a/ZuneHost/ZuneHost.csproj b/ZuneHost/ZuneHost.csproj index 27edeea..3b133a4 100644 --- a/ZuneHost/ZuneHost.csproj +++ b/ZuneHost/ZuneHost.csproj @@ -2,7 +2,7 @@ Exe - net461;net6.0-windows10.0.22000;net6.0; + net472;net6.0-windows10.0.22000;net6.0; AnyCPU;x64;x86;ARM32 11.0 App.config diff --git a/ZuneImpl/ZuneImpl.csproj b/ZuneImpl/ZuneImpl.csproj index 1f9008e..7149d7b 100644 --- a/ZuneImpl/ZuneImpl.csproj +++ b/ZuneImpl/ZuneImpl.csproj @@ -22,7 +22,7 @@ runtime;build;native;contentfiles;analyzers - + diff --git a/ZuneShell/Microsoft/WinRT/ApiInformation.cs b/ZuneShell/Microsoft/WinRT/ApiInformation.cs index 1345d4d..2b9e542 100644 --- a/ZuneShell/Microsoft/WinRT/ApiInformation.cs +++ b/ZuneShell/Microsoft/WinRT/ApiInformation.cs @@ -27,7 +27,7 @@ namespace Microsoft.WinRT { if (Environment.OSVersion.Version >= Win10Version) { - return global::Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeName); + return Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeName); } else { diff --git a/ZuneShell/ZuneUI/TransportControls/TransportControls.cs b/ZuneShell/ZuneUI/TransportControls/TransportControls.cs index 8cb9157..27573a4 100644 --- a/ZuneShell/ZuneUI/TransportControls/TransportControls.cs +++ b/ZuneShell/ZuneUI/TransportControls/TransportControls.cs @@ -1569,7 +1569,7 @@ namespace ZuneUI private void UseSmtc() { // Use SMTC when available -#if WINDOWS +#if WINDOWS8 if (Microsoft.WinRT.ApiInformation.IsTypePresent("Windows.Media.SystemMediaTransportControls") && !OSVersion.IsLessThanWin10()) { @@ -1625,7 +1625,7 @@ namespace ZuneUI private void UpdateSmtcState(PlayerState stateNew) { -#if WINDOWS +#if WINDOWS8 if (Microsoft.WinRT.ApiInformation.IsTypePresent("Windows.Media.SystemMediaTransportControls") && !OSVersion.IsLessThanWin10()) {