add Pilz.Runtime.RuntimeInformationsEx & Pilz.OSType

This commit is contained in:
schedpas
2020-09-15 14:39:30 +02:00
parent b6d2572737
commit ff059104c6
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
Imports System.Runtime.InteropServices
Namespace Runtime
Public Module RuntimeInformationsEx
Public ReadOnly Property OSPlattform
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