private void SbtEventScannerAppearedHandler(SbtScannerInfo scanner) { if (Scanners.Count(m => m.ScannerName == scanner.ScannerName) == 0) { Scanners.Add(new ZebraScanner(scanner)); ScannersChanged?.Invoke(); } if (_activeScannerName != null) { if (scanner.ScannerName == _activeScannerName) { connectedScanner = scanner; apiInstance.SbtEstablishCommunicationSession(scanner.ScannerID); apiInstance.SbtEnableAutomaticSessionReestablishment(true, scanner.ScannerID); } } }
private void SbtEventScannerDisappearedHandler(int scannerID) { Scanners = Scanners.Where(m => m.ScannerID != scannerID).ToList(); ScannersChanged?.Invoke(); }