misc: Migrate usage of RuntimeInformation to OperatingSystem (#2901)

Very basic migration across the codebase.
This commit is contained in:
Mary 2021-12-05 00:02:30 +01:00 committed by GitHub
parent 7c9360d393
commit f39fce8f54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 77 additions and 68 deletions

View file

@ -1,6 +1,6 @@
using Ryujinx.Common.Logging;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Ryujinx.Ui.Helper
{
@ -18,15 +18,15 @@ namespace Ryujinx.Ui.Helper
public static void OpenUrl(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (OperatingSystem.IsWindows())
{
Process.Start(new ProcessStartInfo("cmd", $"/c start {url.Replace("&", "^&")}"));
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
else if (OperatingSystem.IsLinux())
{
Process.Start("xdg-open", url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
else if (OperatingSystem.IsMacOS())
{
Process.Start("open", url);
}