DesktopHost class

Namespace Runic.Desktop · Runic.Desktop 0.7.0-preview.5

public sealed class DesktopHost : IAsyncDisposable

Inherits or implements IAsyncDisposable.

Owns listener resources and a set of isolated presentation surfaces.

Properties

Port

public int Port { get; }

Gets the bound port, or the configured port before the first surface starts.

Methods

CreateSurfaceAsync

public ValueTask<DesktopSurface> CreateSurfaceAsync(DesktopSurfaceOptions? options = null, CancellationToken cancellationToken = default)

Creates and starts one isolated surface namespace.

DisposeAsync

public ValueTask DisposeAsync()

Inherits documentation from IAsyncDisposable.DisposeAsync.

GetAvailability

public DesktopAvailabilityResult GetAvailability()

Inspects presentations available under this host's browser and embedded-host configuration.

GetPresentationPreflight

public DesktopPresentationPreflight GetPresentationPreflight(DesktopWindowOptions? options = null)

Evaluates one requested presentation and its explicit fallback policy without starting a browser or WebView.

Remarks

DesktopPresentationPreflight.OptionDiagnostics reports each window option and permission grant the preferred presentation or its fallback rejects or ignores.

StartAsync

public static ValueTask<DesktopHost> StartAsync(DesktopHostOptions? options = null, CancellationToken cancellationToken = default)

Creates a host. Its listener binds when the first surface starts.

Validate

public DesktopValidationResult Validate(DesktopWindowOptions? options = null)

Checks a window request before it opens: the presentation and its prerequisites, the window options, and the permission grants. Each diagnostic is also logged through DesktopHostOptions.LoggerFactory.

Remarks

Call it at startup and use DesktopValidationResult.ThrowIfInvalid to stop before any window opens. Opening the window repeats the checks it depends on; validation does not start a browser or WebView.