Leadtools.Barcode Namespace : BarcodeReaderErrorMode Enumeration |
[SerializableAttribute()] public enum BarcodeReaderErrorMode : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
'Declaration <SerializableAttribute()> Public Enum BarcodeReaderErrorMode Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
'Usage Dim instance As BarcodeReaderErrorMode
[SerializableAttribute()] public enum BarcodeReaderErrorMode : System.IComparable, System.IConvertible, System.IFormattable
enum LTBarcodeReaderErrorMode
public enum BarcodeReaderErrorMode
Leadtools.Barcode.BarcodeReaderErrorMode = function() { }; Leadtools.Barcode.BarcodeReaderErrorMode.prototype = {
Default = 0, IgnoreAll = 1, };
[SerializableAttribute()] public enum class BarcodeReaderErrorMode : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Value | Member | Description |
---|---|---|
0 | Default |
Default mode. No errors are ignored and an exception will be thrown immediately if an error occurs at any time. |
1 | IgnoreAll |
Ignore all errors. When an error occurs, the exception will be saved and passed to the next BarcodeReader.ReadSymbology event (in the BarcodeReadSymbologyEventArgs.Error member). |
This BarcodeReaderErrorMode enumeration is used as the type for the BarcodeReader.ErrorMode property and is used to determine how to handle the errors when reading barcodes.
The BarcodeReader object might encounter errors when reading barcodes. By default, when an error is encountered, an exception is thrown, usually of type BarcodeException with the BarcodeException.Code set to one of the BarcodeExceptionCode enumeration members, providing more details regarding the error. This is the default behavior.
Sometimes, this behavior may no be desired, for example:
The application is trying to decode barcodes on an "if found and correct" bases. If there were corrupted barcodes, the action is to ignore this and continue. In this case, you can set the error mode to IgnoreAll.
The application is reading multiple barcodes from an image, and the action is to ignore the corrupted barcodes and return only the valid ones found. In this case, you can set the error mode to IgnoreAll and subscribe to the BarcodeReader.ReadSymbology event to get a notification when an error occurs and save the exception for later use. You can then handle these errors when all barcodes are read and the read method returns.
The LEADTOOLS C# and VB Barcode Demo will change the value of BarcodeReader.ErrorMode to IgnoreAll and use the BarcodeReader.ReadSymbology event to show the errors encountered in a list box.
Note that when the BarcodeReader does not find any barcodes in the image, no exception is thrown. Instead, BarcodeReader.ReadBarcode and BarcodeReader.ReadBarcodes methods will return null (Nothing in Visual Basic) or an empty array of BarcodeData instead.
For an example, refer to BarcodeReader.ErrorMode
System.Object
System.ValueType
System.Enum
Leadtools.Barcode.BarcodeReaderErrorMode