Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'UVtools.Core/SystemOS/SystemAware.cs')
-rw-r--r--UVtools.Core/SystemOS/SystemAware.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/UVtools.Core/SystemOS/SystemAware.cs b/UVtools.Core/SystemOS/SystemAware.cs
index 33a8d43..a7d7573 100644
--- a/UVtools.Core/SystemOS/SystemAware.cs
+++ b/UVtools.Core/SystemOS/SystemAware.cs
@@ -300,4 +300,29 @@ public static class SystemAware
/// Gets if is running under MacOS and under app format
/// </summary>
public static bool IsRunningMacOSApp => OperatingSystem.IsMacOS() && AppContext.BaseDirectory.EndsWith(".app/Contents/MacOS");
+
+ /// <summary>
+ /// Gets the main name of the operative system
+ /// </summary>
+ public static string OperatingSystemName
+ {
+ get
+ {
+ if (OperatingSystem.IsWindows()) return "Windows";
+ if (OperatingSystem.IsMacOS()) return "macOS";
+ if (OperatingSystem.IsLinux()) return "Linux";
+ if (OperatingSystem.IsFreeBSD()) return "FreeBSD";
+ if (OperatingSystem.IsAndroid()) return "Android";
+ if (OperatingSystem.IsIOS()) return "iOS";
+ if (OperatingSystem.IsTvOS()) return "Tv OS";
+ if (OperatingSystem.IsWatchOS()) return "WatchOS";
+ if (OperatingSystem.IsBrowser()) return "Browser";
+ return "Unknown";
+ }
+ }
+
+ /// <summary>
+ /// Gets the main name of the operative system with architecture
+ /// </summary>
+ public static string OperatingSystemNameWithArch => $"{OperatingSystemName} {RuntimeInformation.OSArchitecture}";
} \ No newline at end of file