2020-12-01 21:26:00 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2020-05-04 02:15:27 +00:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Common.SystemInfo
|
|
|
|
|
{
|
|
|
|
|
public class SystemInfo
|
|
|
|
|
{
|
|
|
|
|
public virtual string OsDescription => $"{RuntimeInformation.OSDescription} ({RuntimeInformation.OSArchitecture})";
|
|
|
|
|
public virtual string CpuName => "Unknown";
|
|
|
|
|
public virtual ulong RamSize => 0;
|
2020-12-01 21:26:00 +00:00
|
|
|
|
public string RamSizeInMB => (RamSize == 0) ? "Unknown" : $"{RamSize / 1024 / 1024} MB";
|
2020-05-04 02:15:27 +00:00
|
|
|
|
|
|
|
|
|
public static SystemInfo Instance { get; }
|
|
|
|
|
|
|
|
|
|
static SystemInfo()
|
|
|
|
|
{
|
2020-12-01 21:26:00 +00:00
|
|
|
|
if (OperatingSystem.IsWindows())
|
2020-05-04 02:15:27 +00:00
|
|
|
|
{
|
2020-12-01 21:26:00 +00:00
|
|
|
|
Instance = new WindowsSystemInfo();
|
2020-05-04 02:15:27 +00:00
|
|
|
|
}
|
2020-12-01 21:26:00 +00:00
|
|
|
|
else if (OperatingSystem.IsLinux())
|
2020-05-04 02:15:27 +00:00
|
|
|
|
{
|
2020-12-01 21:26:00 +00:00
|
|
|
|
Instance = new LinuxSystemInfo();
|
2020-05-04 02:15:27 +00:00
|
|
|
|
}
|
2020-12-01 21:26:00 +00:00
|
|
|
|
else if (OperatingSystem.IsMacOS())
|
2020-05-04 02:15:27 +00:00
|
|
|
|
{
|
2020-12-01 21:26:00 +00:00
|
|
|
|
Instance = new MacOSSystemInfo();
|
2020-05-04 02:15:27 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Instance = new SystemInfo();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|