Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
BlazorExternalUriLauncher.cs
2using Microsoft.JSInterop;
3
4namespace Gondwana.Blazor;
5
10{
11 private readonly IJSRuntime _jsRuntime;
12
15 public BlazorExternalUriLauncher(IJSRuntime jsRuntime)
16 {
17 _jsRuntime = jsRuntime ?? throw new ArgumentNullException(nameof(jsRuntime));
18 }
19
21 public async ValueTask OpenAsync(Uri uri, CancellationToken cancellationToken = default)
22 {
23 ArgumentNullException.ThrowIfNull(uri);
24 cancellationToken.ThrowIfCancellationRequested();
25
26 if (!uri.IsAbsoluteUri)
27 throw new ArgumentException("External URIs must be absolute.", nameof(uri));
28
29 await _jsRuntime.InvokeVoidAsync(
30 "open",
31 cancellationToken,
32 uri.AbsoluteUri,
33 "_blank",
34 "noopener,noreferrer");
35 }
36}
BlazorExternalUriLauncher(IJSRuntime jsRuntime)
Creates a browser URI launcher backed by the supplied JavaScript runtime.
async ValueTask OpenAsync(Uri uri, CancellationToken cancellationToken=default)
Opens the specified URI using the platform's external URI handler.A task representing the asynchronou...
Defines a platform-specific service for opening external URIs.