feat: Added a settings page.

This commit is contained in:
real-zony
2024-06-28 15:07:06 +08:00
parent 5ccd8a7c53
commit 4f15d06e63
14 changed files with 201 additions and 46 deletions

View File

@@ -0,0 +1,33 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace ZonyLrcTools.Desktop.Helpers;
public static class UrlHelper
{
public static void OpenLink(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
using var process = Process.Start(new ProcessStartInfo
{
FileName = "/bin/sh",
Arguments = $"-c \"xdg-open {url.Replace("\"", "\\\"")}\"",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden
});
}
else
{
using var process = Process.Start(new ProcessStartInfo
{
FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? url : "open",
Arguments = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? url : "",
CreateNoWindow = true,
UseShellExecute = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
});
}
}
}