DesktopNetworkState record

Namespace Runic.Platform in Runic.Platform 0.23.0

public sealed record DesktopNetworkState : IEquatable<DesktopNetworkState>

Inherits or implements IEquatable.

What the operating system knows about the computer's network connection.

Parameters

IsAvailable

Whether a usable network route exists. false always comes with DesktopNetworkConnectivity.None.

Remarks

The operating system's view, not a guarantee that a server answers: try the request and handle its failure, and use the state to explain it or to postpone work, such as a large download on a metered connection.

Constructors

DesktopNetworkState

public DesktopNetworkState(bool IsAvailable)

What the operating system knows about the computer's network connection.

Parameters

IsAvailable

Whether a usable network route exists. false always comes with DesktopNetworkConnectivity.None.

Remarks

The operating system's view, not a guarantee that a server answers: try the request and handle its failure, and use the state to explain it or to postpone work, such as a large download on a metered connection.

Properties

Connectivity

public DesktopNetworkConnectivity Connectivity { get; init; }

How far the connection reaches, as the operating system's own connectivity check found; DesktopNetworkConnectivity.Unknown where it does not check.

IsAvailable

public bool IsAvailable { get; init; }

Whether a usable network route exists. false always comes with DesktopNetworkConnectivity.None.

IsMetered

public bool? IsMetered { get; init; }

Whether the connection is metered or limited in data, such as a mobile hotspot or Low Data Mode; null when the operating system does not say.