mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 14:54:00 +00:00
f39fce8f54
Very basic migration across the codebase.
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using Ryujinx.Common.Logging;
|
|
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace Ryujinx.Ui.Helper
|
|
{
|
|
static class OpenHelper
|
|
{
|
|
public static void OpenFolder(string path)
|
|
{
|
|
Process.Start(new ProcessStartInfo
|
|
{
|
|
FileName = path,
|
|
UseShellExecute = true,
|
|
Verb = "open"
|
|
});
|
|
}
|
|
|
|
public static void OpenUrl(string url)
|
|
{
|
|
if (OperatingSystem.IsWindows())
|
|
{
|
|
Process.Start(new ProcessStartInfo("cmd", $"/c start {url.Replace("&", "^&")}"));
|
|
}
|
|
else if (OperatingSystem.IsLinux())
|
|
{
|
|
Process.Start("xdg-open", url);
|
|
}
|
|
else if (OperatingSystem.IsMacOS())
|
|
{
|
|
Process.Start("open", url);
|
|
}
|
|
else
|
|
{
|
|
Logger.Notice.Print(LogClass.Application, $"Cannot open url \"{url}\" on this platform!");
|
|
}
|
|
}
|
|
}
|
|
} |