Esempio n. 1
0
        static RuntimeInformation()
        {
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.Unix:
                if (Directory.Exists("/Applications") & Directory.Exists("/System") & Directory.Exists("/Users") & Directory.Exists("/Volumes"))
                {
                    _osPlatform = OSPlatform.OSX;
                }
                else
                {
                    _osPlatform = OSPlatform.Linux;
                }
                break;

            case PlatformID.MacOSX:
                _osPlatform = OSPlatform.OSX;
                break;

            default:
                _osPlatform = OSPlatform.Windows;
                break;
            }
        }
Esempio n. 2
0
 public static bool IsOSPlatform(OSPlatform osPlatform) => _osPlatform == osPlatform;