public sealed record DesktopNetworkState : IEquatable<DesktopNetworkState> What the operating system knows about the computer's network connection.
Parameters
IsAvailableWhether a usable network route exists.
falsealways comes withDesktopNetworkConnectivity.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
IsAvailableWhether a usable network route exists.
falsealways comes withDesktopNetworkConnectivity.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.