public void OpenDevice() { if (_gps != null) { return; } _gps = new GpsUnit(new NmeaSerialPort("COM2", 19200)); _gps.LocationChanged += OnLocationChanged; }
public void CloseDevice() { if (_gps == null) { return; } _gps.LocationChanged -= OnLocationChanged; ((IDisposable)_gps).Dispose(); _gps = null; }