@@ -7,66 +7,6 @@ namespace Terminal.Gui.Drivers;
77/// </summary>
88public static class PlatformDetection
99{
10- /// <summary>
11- /// Determines whether the current operating system is Linux.
12- /// </summary>
13- /// <remarks>
14- /// This method returns <see langword="true"/> only when running on a Linux
15- /// distribution. Other Unix-like platforms such as macOS and FreeBSD
16- /// return <see langword="false"/>.
17- /// </remarks>
18- /// <returns>
19- /// <see langword="true"/> if the operating system is Linux;
20- /// otherwise, <see langword="false"/>.
21- /// </returns>
22- public static bool IsLinux ( ) => RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) ;
23-
24- /// <summary>
25- /// Determines whether the current operating system is macOS.
26- /// </summary>
27- /// <returns>true if the current operating system is macOS; otherwise, false.</returns>
28- public static bool IsMac ( ) => RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) ;
29-
30- /// <summary>
31- /// Determines whether the current operating system is a Unix-like platform.
32- /// </summary>
33- /// <remarks>
34- /// Unix-like platforms include operating systems that derive from or
35- /// closely follow traditional UNIX and POSIX design principles.
36- /// On .NET, this currently includes Linux, macOS (Darwin), and FreeBSD.
37- /// </remarks>
38- /// <returns>
39- /// <see langword="true"/> if the operating system is Linux, macOS, or FreeBSD;
40- /// otherwise, <see langword="false"/>.
41- /// </returns>
42- public static bool IsUnixLike ( ) =>
43- RuntimeInformation . IsOSPlatform ( OSPlatform . Linux )
44- || RuntimeInformation . IsOSPlatform ( OSPlatform . OSX )
45- || RuntimeInformation . IsOSPlatform ( OSPlatform . FreeBSD ) ;
46-
47-
48- /// <summary>Returns the <see cref="TuiPlatform"/> for the current operating system.</summary>
49- public static TuiPlatform GetCurrentPlatform ( )
50- {
51- if ( IsWindows ( ) )
52- {
53- return TuiPlatform . Windows ;
54- }
55-
56- if ( IsMac ( ) )
57- {
58- return TuiPlatform . Macos ;
59- }
60-
61- return TuiPlatform . Linux ;
62- }
63-
64- /// <summary>
65- /// Determines if the current platform is Windows.
66- /// </summary>
67- /// <returns></returns>
68- public static bool IsWindows ( ) => RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ;
69-
7010 /// <summary>
7111 /// Determines if the current platform is WSL (Windows Subsystem for Linux).
7212 /// </summary>
0 commit comments