diff --git a/SteamToolsV2+.sln b/SteamToolsV2+.sln index f37c63e32..d433ca257 100644 --- a/SteamToolsV2+.sln +++ b/SteamToolsV2+.sln @@ -91,8 +91,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArchiSteamFarm.Library", "r EndProject Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ST.Client.Avalonia.App.Bridge.Package", "src\ST.Client.Desktop.Avalonia.App.Bridge.Package\ST.Client.Avalonia.App.Bridge.Package.wapproj", "{1F659618-71E2-4AAF-9D86-62700FD4CF02}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-std", "references\sqlite-net\nuget\SQLite-net-std\SQLite-net-std.csproj", "{B1F221F6-E19B-45D8-959D-A9CDA471C2D4}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steam++", "src\ST.Client.Desktop.Avalonia.App.Bridge\Steam++.csproj", "{2A66B796-7BC2-4BE0-A920-1A457BBCCC67}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Tools.DesktopBridgeLink", "src\ST.Tools.DesktopBridgeLink\ST.Tools.DesktopBridgeLink.csproj", "{137690DF-A3CB-4817-ACB8-9EAF3A52B5B5}" @@ -1013,34 +1011,6 @@ Global {1F659618-71E2-4AAF-9D86-62700FD4CF02}.Release|x86.ActiveCfg = Release|x86 {1F659618-71E2-4AAF-9D86-62700FD4CF02}.Release|x86.Build.0 = Release|x86 {1F659618-71E2-4AAF-9D86-62700FD4CF02}.Release|x86.Deploy.0 = Release|x86 - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|ARM.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|ARM.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|ARM64.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|iPhone.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|x64.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|x64.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|x86.ActiveCfg = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Debug|x86.Build.0 = Debug|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|Any CPU.Build.0 = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|ARM.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|ARM.Build.0 = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|ARM64.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|ARM64.Build.0 = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|iPhone.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|iPhone.Build.0 = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|x64.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|x64.Build.0 = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|x86.ActiveCfg = Release|Any CPU - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4}.Release|x86.Build.0 = Release|Any CPU {2A66B796-7BC2-4BE0-A920-1A457BBCCC67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2A66B796-7BC2-4BE0-A920-1A457BBCCC67}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A66B796-7BC2-4BE0-A920-1A457BBCCC67}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -1272,7 +1242,6 @@ Global {9A8D2254-9B2B-4B92-8498-43A73BB9A410} = {E448F863-4C9D-47A4-BC4A-4A1381B54DA4} {F4D8CD7B-6DF4-445C-AFA9-44466A552922} = {673FF8CD-9E85-4FA1-ABFC-D1149675E138} {1F659618-71E2-4AAF-9D86-62700FD4CF02} = {1B889C56-157A-4493-85F2-76366282B002} - {B1F221F6-E19B-45D8-959D-A9CDA471C2D4} = {673FF8CD-9E85-4FA1-ABFC-D1149675E138} {2A66B796-7BC2-4BE0-A920-1A457BBCCC67} = {1B889C56-157A-4493-85F2-76366282B002} {137690DF-A3CB-4817-ACB8-9EAF3A52B5B5} = {E448F863-4C9D-47A4-BC4A-4A1381B54DA4} {42154590-445B-41CF-AAEB-AACD1B65FA2C} = {673FF8CD-9E85-4FA1-ABFC-D1149675E138} diff --git a/references/runtime.win7-x64.Microsoft.NETCore.Windows.ApiSets/api-ms-win-core-winrt-l1-1-0.dll b/references/runtime.win7-x64.Microsoft.NETCore.Windows.ApiSets/api-ms-win-core-winrt-l1-1-0.dll new file mode 100644 index 000000000..039e3b2d4 Binary files /dev/null and b/references/runtime.win7-x64.Microsoft.NETCore.Windows.ApiSets/api-ms-win-core-winrt-l1-1-0.dll differ diff --git a/src/Repositories.sqlite-net-pcl/Repositories.sqlite-net-pcl.csproj b/src/Repositories.sqlite-net-pcl/Repositories.sqlite-net-pcl.csproj index e3fe8f9ae..11860c1ab 100644 --- a/src/Repositories.sqlite-net-pcl/Repositories.sqlite-net-pcl.csproj +++ b/src/Repositories.sqlite-net-pcl/Repositories.sqlite-net-pcl.csproj @@ -19,12 +19,11 @@ - - + \ No newline at end of file diff --git a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml index 875f7c1b5..b7f17d9f1 100644 --- a/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml +++ b/src/ST.Client.Desktop.Avalonia.App/Properties/PublishProfiles/win-x64.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - PUBLISH;WINDOWS; + PUBLISH;PUBLISH_WIN7;WINDOWS; Release bin\Release\Publish\win-x64 FileSystem @@ -12,8 +12,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Any CPU net6.0 true - false - + + + + + + true true diff --git a/src/ST.Client.Desktop.Avalonia.App/ST.Client.Avalonia.App.csproj b/src/ST.Client.Desktop.Avalonia.App/ST.Client.Avalonia.App.csproj index e6493f211..0f429fa67 100644 --- a/src/ST.Client.Desktop.Avalonia.App/ST.Client.Avalonia.App.csproj +++ b/src/ST.Client.Desktop.Avalonia.App/ST.Client.Avalonia.App.csproj @@ -94,6 +94,12 @@ + + + PreserveNewest + + + diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs index 17c15be76..b27023c24 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs @@ -50,15 +50,18 @@ namespace Avalonia.Controls if (!ViewModelBase.IsInDesignMode) { - if (OperatingSystem2.IsWindows7) + if (OperatingSystem2.IsWindows) { + if (OperatingSystem2.IsWindows7) + { #pragma warning disable CA1416 // 验证平台兼容性 - IPlatformService.Instance.FixAvaloniaFluentWindowStyleOnWin7(PlatformImpl.Handle.Handle); + IPlatformService.Instance.FixAvaloniaFluentWindowStyleOnWin7(PlatformImpl.Handle.Handle); #pragma warning restore CA1416 // 验证平台兼容性 - } - else if (OperatingSystem2.IsWindows10AtLeast) - { - AvaloniaLocator.Current.GetService().ForceNativeTitleBarToTheme(this, "Dark"); + } + else if (OperatingSystem2.IsWindows10AtLeast) + { + AvaloniaLocator.Current.GetService().ForceNativeTitleBarToTheme(this, "Dark"); + } } } } diff --git a/src/ST.Client.Desktop.Windows/Services/Implementation/WindowsPlatformServiceImpl.WindowTopRightButtons.cs b/src/ST.Client.Desktop.Windows/Services/Implementation/WindowsPlatformServiceImpl.WindowTopRightButtons.cs index a31f6b33e..4b1654023 100644 --- a/src/ST.Client.Desktop.Windows/Services/Implementation/WindowsPlatformServiceImpl.WindowTopRightButtons.cs +++ b/src/ST.Client.Desktop.Windows/Services/Implementation/WindowsPlatformServiceImpl.WindowTopRightButtons.cs @@ -16,7 +16,7 @@ namespace System.Application.Services.Implementation public const int SC_MAXIMIZE = 0xF030; //public const int CS_DROPSHADOW = 0x20000; - public void FixFluentWindowStyleOnWin7(IntPtr hWnd) + public void FixAvaloniaFluentWindowStyleOnWin7(IntPtr hWnd) { if (!OperatingSystem2.IsWindows7) return; var value = GetWindowLong(hWnd, GWL_STYLE); diff --git a/src/ST.Client/Services/IPlatformService.MacOS.cs b/src/ST.Client/Services/IPlatformService.MacOS.cs index 7235dc041..fbdb7afd1 100644 --- a/src/ST.Client/Services/IPlatformService.MacOS.cs +++ b/src/ST.Client/Services/IPlatformService.MacOS.cs @@ -12,6 +12,9 @@ namespace System.Application.Services partial interface IPlatformService { [SupportedOSPlatform("MacOS")] - string[] GetMacNetworkSetup() => throw new PlatformNotSupportedException(); + string[] GetMacNetworkSetup() + { + return Array.Empty(); + } } } diff --git a/src/ST.Client/Services/IPlatformService.Windows.cs b/src/ST.Client/Services/IPlatformService.Windows.cs index 4bc138754..692213b3d 100644 --- a/src/ST.Client/Services/IPlatformService.Windows.cs +++ b/src/ST.Client/Services/IPlatformService.Windows.cs @@ -13,10 +13,16 @@ namespace System.Application.Services /// 打开桌面图标设置 /// [SupportedOSPlatform("Windows")] - void OpenDesktopIconsSettings() => throw new PlatformNotSupportedException(); + void OpenDesktopIconsSettings() + { + + } [SupportedOSPlatform("Windows")] - void OpenGameControllers() => throw new PlatformNotSupportedException(); + void OpenGameControllers() + { + + } /// /// 已正常权限启动进程 @@ -24,7 +30,10 @@ namespace System.Application.Services /// /// [SupportedOSPlatform("Windows")] - Process StartAsInvoker(string fileName) => throw new PlatformNotSupportedException(); + Process StartAsInvoker(string fileName) + { + return Process.Start(fileName); + } /// /// 获取占用端口的进程 @@ -33,34 +42,43 @@ namespace System.Application.Services /// /// [SupportedOSPlatform("Windows")] - Process? GetProcessByPortOccupy(ushort port, bool isTCPorUDP = true) => throw new PlatformNotSupportedException(); + Process? GetProcessByPortOccupy(ushort port, bool isTCPorUDP = true) + { + return null; + } /// /// 从管理员权限进程中降权到普通权限启动进程 /// /// [SupportedOSPlatform("Windows")] - void UnelevatedProcessStart(string cmdArgs) => throw new PlatformNotSupportedException(); + void UnelevatedProcessStart(string cmdArgs) + { + + } [SupportedOSPlatform("Windows")] - void FixAvaloniaFluentWindowStyleOnWin7(IntPtr hWnd) => throw new PlatformNotSupportedException(); + void FixAvaloniaFluentWindowStyleOnWin7(IntPtr hWnd) + { + + } /// /// 获取当前 Windows 系统产品名称,例如 Windows 10 Pro /// [SupportedOSPlatform("Windows")] - string WindowsProductName => throw new PlatformNotSupportedException(); + string WindowsProductName => string.Empty; /// /// 获取当前 Windows 系统第四位版本号 /// [SupportedOSPlatform("Windows")] - int WindowsVersionRevision => throw new PlatformNotSupportedException(); + int WindowsVersionRevision => default; /// /// 获取当前 Windows 10/11 系统显示版本,例如 21H1 /// [SupportedOSPlatform("Windows")] - string WindowsReleaseIdOrDisplayVersion => throw new PlatformNotSupportedException(); + string WindowsReleaseIdOrDisplayVersion => string.Empty; } } diff --git a/src/ST.Client/Services/IPlatformService.cs b/src/ST.Client/Services/IPlatformService.cs index 87887e944..baf030576 100644 --- a/src/ST.Client/Services/IPlatformService.cs +++ b/src/ST.Client/Services/IPlatformService.cs @@ -30,7 +30,10 @@ namespace System.Application.Services async void RunShell(string script, bool admin = false) => await RunShellAsync(script, admin); /// - ValueTask RunShellAsync(string script, bool admin = false) => throw new PlatformNotSupportedException(); + ValueTask RunShellAsync(string script, bool admin = false) + { + return new(); + } /// /// 使用文本阅读器打开文件 @@ -182,32 +185,47 @@ namespace System.Application.Services /// 使用资源管理器打开文件夹路径 /// /// - void OpenFolderByDirectoryPath(DirectoryInfo info) => throw new PlatformNotSupportedException(); + void OpenFolderByDirectoryPath(DirectoryInfo info) + { + + } /// /// 使用资源管理器选中文件路径 /// /// - void OpenFolderSelectFilePath(FileInfo info) => throw new PlatformNotSupportedException(); + void OpenFolderSelectFilePath(FileInfo info) + { + + } /// /// 设置系统关闭时任务 /// - void SetSystemSessionEnding(Action action) => throw new PlatformNotSupportedException(); + void SetSystemSessionEnding(Action action) + { + + } /// /// 获取文本阅读器提供商程序文件路径或文件名(如果提供程序已注册环境变量) /// /// /// - string? GetFileName(TextReaderProvider provider) => throw new PlatformNotSupportedException(); + string? GetFileName(TextReaderProvider provider) + { + return null; + } /// /// 设置开机自启动 /// /// 开启、关闭 /// - void SetBootAutoStart(bool isAutoStart, string name) => throw new PlatformNotSupportedException(); + void SetBootAutoStart(bool isAutoStart, string name) + { + + } #region Steam diff --git a/src/ST.Client/UI/ViewModels/Base/IPageViewModel.cs b/src/ST.Client/UI/ViewModels/Base/IPageViewModel.cs new file mode 100644 index 000000000..f3b3be480 --- /dev/null +++ b/src/ST.Client/UI/ViewModels/Base/IPageViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +// ReSharper disable once CheckNamespace +namespace System.Application.UI.ViewModels +{ + public interface IPageViewModel : IViewModelBase + { + string Title { get; set; } + } +} diff --git a/src/ST.Client/UI/ViewModels/Base/IWindowViewModel.cs b/src/ST.Client/UI/ViewModels/Base/IWindowViewModel.cs new file mode 100644 index 000000000..af9fc8e43 --- /dev/null +++ b/src/ST.Client/UI/ViewModels/Base/IWindowViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +// ReSharper disable once CheckNamespace +namespace System.Application.UI.ViewModels +{ + public interface IWindowViewModel : IPageViewModel + { + /// + /// 是否支持窗口大小与位置 + /// + public static bool IsSupportedSizePosition { protected get; set; } = true; + } +} diff --git a/src/ST.Client/UI/ViewModels/General/PageViewModel.cs b/src/ST.Client/UI/ViewModels/General/PageViewModel.cs index fc63d6a09..8896c1372 100644 --- a/src/ST.Client/UI/ViewModels/General/PageViewModel.cs +++ b/src/ST.Client/UI/ViewModels/General/PageViewModel.cs @@ -9,7 +9,7 @@ using System.Text; // ReSharper disable once CheckNamespace namespace System.Application.UI.ViewModels { - public class PageViewModel : ViewModelBase + public class PageViewModel : ViewModelBase, IPageViewModel { protected string title = string.Empty; [IgnoreDataMember] diff --git a/src/ST.Client/UI/ViewModels/General/WindowViewModel.cs b/src/ST.Client/UI/ViewModels/General/WindowViewModel.cs index 4f221fe99..8b3973df2 100644 --- a/src/ST.Client/UI/ViewModels/General/WindowViewModel.cs +++ b/src/ST.Client/UI/ViewModels/General/WindowViewModel.cs @@ -10,9 +10,9 @@ using System.Text; // ReSharper disable once CheckNamespace namespace System.Application.UI.ViewModels { - public class WindowViewModel : PageViewModel + public class WindowViewModel : PageViewModel, IWindowViewModel { - public static bool IsSupportedSizePosition { get; set; } = true; + public static bool IsSupportedSizePosition => IWindowViewModel.IsSupportedSizePosition; protected SizePosition? _SizePosition; public SizePosition SizePosition