Link Search Menu Expand Document

BarcodeException Class

Represents errors that occur during Bytescout.BarCode class library execution.
Inheritance Hierarchy
SystemObject
SystemException
Bytescout.BarCodeBarcodeException
Bytescout.BarCodeBarcodeProfileException

Namespace:Bytescout.BarCode
Assembly: Bytescout.BarCode (in Bytescout.BarCode.dll) Version: 7.6.3.1256-master
Syntax
public class BarcodeException : Exception

The BarcodeException type exposes the following members.

Constructors
NameDescription
Public methodBarcodeException(String)
Initializes a new instance of the BarcodeException class with a specified error message.
Public methodBarcodeException(String, Exception)
Initializes a new instance of the BarcodeException class with a specified error message and inner exception.
Top
Properties
NameDescription
Public propertyData (Inherited from Exception.)
Public propertyHelpLink (Inherited from Exception.)
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertyTargetSite (Inherited from Exception.)
Top
Methods
NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetBaseException (Inherited from Exception.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectData (Inherited from Exception.)
Public methodGetType (Inherited from Exception.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Exception.)
Top
Events
NameDescription
Protected eventSerializeObjectState (Inherited from Exception.)
Top
Examples
The following example demonstrates usage of BarcodeException class.
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Barcode bc = new Barcode(SymbologyType.Code128);
            bc.Options.Code128Alphabet = Code128Alphabet.C;

            try
            {
                bc.Value = "DATA";
            }
            catch (BarcodeException e)
            {
                Console.WriteLine("BarcodeException Handler: {0}", e.ToString());
             }
             catch (Exception e) 
             {
                Console.WriteLine("Generic Exception Handler: {0}", e.ToString());
             }
        }
    }
}

// 
// This code example produces the following results:
// 
// BarcodeException Handler: Bytescout.Barcode.BarcodeException: provided value 
// can't be encoded by current symbology.
// Code 128 Alphabet C allows only numeric values with even length.
//     at Bytescout.BarCode.Internal.SymbologyDrawing.set_Value(String value)
See Also

Reference