Class BarCodeScanner
- Namespace
- Acuit.Pinpoint.BarCodeScanning
- Assembly
- Acuit.Pinpoint.BarCodeScanning.dll
A base class for implementing IBarCodeScanner and IConnectedDevice.
public abstract class BarCodeScanner : ConnectedDevice, IConnectedDevice, IHealthCheck, IDisposable, IAsyncDisposable, IBarCodeScanner
- Inheritance
-
BarCodeScanner
- Implements
- Derived
- Inherited Members
Remarks
Derived classes must do the following:
- Implement DoConnectAsync(CancellationToken) and DoDisconnectAsync(CancellationToken). Implementations can assume that they will never be called concurrently.
- Call OnExternalDeviceClosedConnection(Exception) if the connection is closed from the external device (but not when the connection is closed due to DoDisconnectAsync(CancellationToken)).
- Call OnBarCodeScanned(BarCodeScanEventArgs) when a bar code is scanned.
- Override Dispose(bool) and DisposeAsyncCore() as needed (when overriding one, always override the other as well).
Constructors
BarCodeScanner(ILogger)
Initializes a new instance of the BarCodeScanner class.
protected BarCodeScanner(ILogger logger)
Parameters
logger
ILoggerThe logger.
Exceptions
- ArgumentNullException
logger
is null.
Methods
OnBarCodeScanned(BarCodeScanEventArgs)
Raises the BarCodeScanned event.
protected virtual void OnBarCodeScanned(BarCodeScanEventArgs e)
Parameters
e
BarCodeScanEventArgsThe event data.
Events
BarCodeScanned
Occurs when a bar code is scanned.
public event EventHandler<BarCodeScanEventArgs> BarCodeScanned
Event Type
Remarks
This event might be raised on a background worker thread.