protected override void Dispose(bool disposing) { if (disposing) { if (_scanner != null) { _scanner.Data -= ReceivedScanData; _scanner?.Release(); _scanner?.Dispose(); } _barcodeManager?.Dispose(); _emdkManager?.Release(); _emdkManager?.Dispose(); } base.Dispose(disposing); }