Files
Pilz/Pilz/Runtime/RuntimeInformationsEx.vb

29 lines
814 B
VB.net

Imports System.Runtime.InteropServices
Namespace Runtime
Public Module RuntimeInformationsEx
Public ReadOnly Property OSType As OSType
Get
Static t As OSType? = Nothing
If t Is Nothing Then
Select Case True
Case RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
t = OSType.Windows
Case RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
t = OSType.Linux
Case RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
t = OSType.OSX
End Select
End If
Return t
End Get
End Property
End Module
End Namespace