RunicHostedServiceDecision class

Namespace Runic.Application.Views.Desktop in Runic.Application.Views.Desktop 0.23.0

public sealed class RunicHostedServiceDecision

A host policy's decision about a guest's window service.

Remarks

Experimental; see docs/experimental.md.

Properties

IsAllowed

public bool IsAllowed { get; }

Whether the service runs.

Message

public string? Message { get; }

For a refusal, why, as the guest's failure message; it must not carry a secret.

Request

public RunicHostedServiceRequest? Request { get; }

The request that runs instead of the guest's, or null for the guest's.

Methods

Allow

public static RunicHostedServiceDecision Allow()

Runs the guest's request.

Returns

The decision.

Apply

public static RunicHostedServiceDecision Apply(RunicHostedServiceRequest request)

Runs a changed request instead: for a RunicHostedServiceKind.Launch another RunicHostedServiceRequest.Uri, RunicHostedServiceRequest.Path or RunicHostedServiceRequest.Operation, such as request with { Operation = DesktopFileOperation.Reveal }; for a RunicHostedServiceKind.FileDrop other absolute RunicHostedServiceRequest.Paths, such as only some of them; for a RunicHostedServiceKind.ClipboardWrite fewer RunicHostedServiceRequest.ClipboardFormats, which writes only those of the guest's content (none writes nothing and succeeds); for a RunicHostedServiceKind.ClipboardRead of one format, DesktopClipboardFormats.None, which reads as if the clipboard had no such format. For RunicHostedServiceKind.Monitors it allows the guest's request. It keeps the request's kind and window, and a clipboard request's formats can only shrink: another kind, window or format fails the guest's request.

Parameters

request

The request to run.

Returns

The decision.

Refuse

public static RunicHostedServiceDecision Refuse(string? message = null)

Refuses the request: the guest receives PlatformFailureCode.PermissionDenied.

Parameters

message

Why, for the guest; at most 1,024 characters are sent.

Returns

The decision.