ConnectionStatusChange
public sealed record ConnectionStatusChange : IEquatable<ConnectionStatusChange>
A change of connection status.
Delivered to the handler registered with ThermalCamera.OnConnectionStatus(…), on transitions only. A link that is dead and stays dead reports ConnectionStatus.Stalled once, not once per timeout period.
Example
camera.OnConnectionStatus(change => ui.Dispatcher.Post(() => { ui.ImageIsLive = change.IsLive; if (!change.IsLive) { ui.Banner = $"No live image: {change.Current}"; } }));
ConnectionStatusChange: constructors
public ConnectionStatusChange(ConnectionStatus Previous, ConnectionStatus Current, string Message)
A change of connection status.
Previous: The status held before this change.Current: The status now in effect. MatchesThermalCamera.ConnectionStatusuntil the next change.Message: Human-readable detail from the SDK: the reason an open failed, for instance. May be empty. Meant for logs and diagnostics; branch onCurrent, not on this.
Delivered to the handler registered with ThermalCamera.OnConnectionStatus(…), on transitions only. A link that is dead and stays dead reports ConnectionStatus.Stalled once, not once per timeout period.
Example
camera.OnConnectionStatus(change => ui.Dispatcher.Post(() => { ui.ImageIsLive = change.IsLive; if (!change.IsLive) { ui.Banner = $"No live image: {change.Current}"; } }));
ConnectionStatusChange: properties
public ConnectionStatus Current { get; init; }
The status now in effect. Matches ThermalCamera.ConnectionStatus until the next change.
public bool IsLive { get; }
Whether frames can be trusted to be arriving right now.
The question a status indicator actually asks, answered once here so every caller does not have to enumerate the states.
public string Message { get; init; }
Human-readable detail from the SDK: the reason an open failed, for instance. May be empty. Meant for logs and diagnostics; branch on Current, not on this.
public ConnectionStatus Previous { get; init; }
The status held before this change.