-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathExtension.vb
More file actions
37 lines (30 loc) · 1.1 KB
/
Extension.vb
File metadata and controls
37 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Option Explicit On
Option Strict On
Option Infer On
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
Public Module Extension
'' Inspired by https://mariusschulz.com/blog/detecting-the-operating-system-in-net-core
'' Tweaked to be Extension Methods for the existing OperatingSystem class.
'<Extension>
'Public Function IsWindows(os As OperatingSystem) As Boolean
' If os Is Nothing Then
' ' Just to remove the warning for not using the 'os' variable.
' End If
' Return RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
'End Function
'<Extension>
'Public Function IsLinux(os As OperatingSystem) As Boolean
' If os Is Nothing Then
' ' Just to remove the warning for not using the 'os' variable.
' End If
' Return RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
'End Function
'<Extension>
'Public Function IsOSX(os As OperatingSystem) As Boolean
' If os Is Nothing Then
' ' Just to remove the warning for not using the 'os' variable.
' End If
' Return RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
'End Function
End Module