Class Platform
- Namespace
- CarinaStudio
- Assembly
- CarinaStudio.AppBase.Core.dll
Utility class to provide platform specific functions.
public static class Platform
- Inheritance
-
Platform
- Inherited Members
Properties
IsAndroid
Check whether current operating system is Android of not.
public static bool IsAndroid { get; }
Property Value
IsGnome
Check whether the desktop environment is GNOME or not if current operating system is Linux.
[Obsolete("Use LinuxDesktop instead.")]
public static bool IsGnome { get; }
Property Value
IsIOS
Check whether current operating system is iOS of not.
public static bool IsIOS { get; }
Property Value
IsLinux
Check whether current operating system is Linux of not.
public static bool IsLinux { get; }
Property Value
Remarks
Please noted that the value is also True on Android platform.
IsMacOS
Check whether current operating system is macOS of not.
public static bool IsMacOS { get; }
Property Value
IsNotAndroid
Check whether current operating system is not Android of not.
public static bool IsNotAndroid { get; }
Property Value
IsNotIOS
Check whether current operating system is not iOS of not.
public static bool IsNotIOS { get; }
Property Value
IsNotLinux
Check whether current operating system is not Linux of not.
public static bool IsNotLinux { get; }
Property Value
IsNotMacOS
Check whether current operating system is not macOS of not.
public static bool IsNotMacOS { get; }
Property Value
IsNotWindows
Check whether current operating system is not Windows of not.
public static bool IsNotWindows { get; }
Property Value
IsOpeningFileManagerSupported
Check whether opening system file manager is supported or not.
public static bool IsOpeningFileManagerSupported { get; }
Property Value
IsOpeningLinkSupported
Check whether opening URI by default browser is supported on current platform or not.
public static bool IsOpeningLinkSupported { get; }
Property Value
IsWindows
Check whether current operating system is Windows of not.
public static bool IsWindows { get; }
Property Value
IsWindows10OrAbove
Check whether the version of Windows is Windows 10+ or not.
public static bool IsWindows10OrAbove { get; }
Property Value
IsWindows11OrAbove
Check whether the version of Windows is Windows 11+ or not.
public static bool IsWindows11OrAbove { get; }
Property Value
IsWindows8OrAbove
Check whether the version of Windows is Windows 8+ or not.
public static bool IsWindows8OrAbove { get; }
Property Value
LinuxDesktop
Get current desktop environment running on Linux.
public static LinuxDesktop LinuxDesktop { get; }
Property Value
LinuxDistribution
Get Linux distribution if current operating system is Linux.
public static LinuxDistribution LinuxDistribution { get; }
Property Value
WindowsVersion
Get version of Windows currently running on.
public static WindowsVersion WindowsVersion { get; }
Property Value
Methods
GetInstalledRuntimeVersion(bool)
Get the latest version of .NET Runtime installed on device.
public static Version? GetInstalledRuntimeVersion(bool stableVersionOnly = true)
Parameters
stableVersionOnly
boolTrue to include stable version only.
Returns
- Version
Installed .NET Runtime version, or null if .NET Runtime is not installed on device.
GetInstalledRuntimeVersionAsync(bool)
Get the latest version of .NET Runtime installed on device
public static Task<Version?> GetInstalledRuntimeVersionAsync(bool stableVersionOnly = true)
Parameters
stableVersionOnly
boolTrue to include stable version only.
Returns
- Task<Version>
Task of getting version. The result will be null if .NET Runtime is not installed on device.
GetInstalledRuntimeVersionAsync(bool, CancellationToken)
Get the latest version of .NET Runtime installed on device
public static Task<Version?> GetInstalledRuntimeVersionAsync(bool stableVersionOnly, CancellationToken cancellationToken)
Parameters
stableVersionOnly
boolTrue to include stable version only.
cancellationToken
CancellationTokenCancellation token.
Returns
- Task<Version>
Task of getting version. The result will be null if .NET Runtime is not installed on device.
OpenFileManager(string)
Open system file manager and show given file or directory.
public static void OpenFileManager(string path)
Parameters
path
stringPath of file or directory to show.
OpenLink(string)
Open given URI by default browser.
public static bool OpenLink(string uri)
Parameters
uri
stringURI to open.
Returns
- bool
True if URI opened successfully.
OpenLink(Uri)
Open given Uri by default browser.
public static bool OpenLink(Uri uri)
Parameters
Returns
- bool
True if URI opened successfully.