Class PlatformDetection
- Namespace
- Datafication.Core.Platform
- Assembly
- Datafication.Core.dll
Provides utility methods for detecting the platform or runtime environment.
public static class PlatformDetection
- Inheritance
-
objectPlatformDetection
Remarks
This class helps identify if the application is running in specific environments, such as Blazor WebAssembly.
Methods
IsRunningInBrowser()
Determines whether the application is running in a browser environment (Blazor WebAssembly).
public static bool IsRunningInBrowser()
Returns
- bool
trueif the application is running in a WebAssembly environment in the browser; otherwise,false.
Examples
if (PlatformDetection.IsRunningInBrowser())
{
Console.WriteLine("Running in a Blazor WebAssembly environment.");
}
Remarks
This method uses System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform) to check if the platform is identified as "BROWSER".