Saradomin-Launcher/Saradomin/Utilities/CrossPlatform.cs
2022-05-26 22:09:42 +02:00

24 lines
No EOL
640 B
C#

using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Saradomin.Utilities
{
public static class CrossPlatform
{
public static void LaunchURL(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Process.Start(url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url);
}
}
}
}