CBielstein / APRSsharp

APRS# - Modern APRS software for the amateur radio community
MIT License
12 stars 5 forks source link

Add AprsIsConnection.State and State Change Events #116

Closed CBielstein closed 2 years ago

CBielstein commented 2 years ago

Description

This switches from a simple "logged in" Boolean flag to tracking state across the full life of the AprsIsConnection object. It also adds an event which can be subscribed to for notifications of when that status changes.

This is especially useful for clients who may wish to know when a connection has been achieved, a login complete, or some error has lead to a disconnect and a new connection is required.

Changes

Validation

CBielstein commented 2 years ago

Note to @eddywine for review: Since I add a layer of indentation for the try-finally in AprsIsConnection AND change a few lines, the diff is all weird there. It may be easier to disable whitespace in the diff. That setting is under the gear in the files tab: image