BarcodeReader.ScannerNotify Event

An event that passes information about scanner events to the application as device state changed.

Namespace: Honeywell.Mobility.DataCollection

Assembly: Honeywell.Mobility.DataCollection.FF3.5 (in Honeywell.Mobility.DataCollection.FF3.5.dll)

[C#]
public event ScannerNotifyEventHandler ScannerNotify
[Visual Basic (Declaration)]
Public Event ScannerNotify As ScannerNotifyEventHandler

Examples

[C#]
using Honeywell.Mobility.DataCollection;
namespace DataCollection
{
    public partial class frmBarcodeReader : Form
    {
        private Honeywell.Mobility.DataCollection.BarcodeReader bcr;

        public frmBarcodeReader()
        {
            InitializeComponent();

            try
            {
                bcr = new Honeywell.Mobility.DataCollection.BarcodeReader();
                bcr.ScannerNotify += new ScannerNotifyEventHandler(bcr_ScannerNotify);
            }
            catch (BarcodeReaderException bcrexp)
            {
                MessageBox.Show(bcrexp.Message);
            }
        }

        void bcr_ScannerNotify(object sender, ScannerNotifyEventArgs snotify)
        {
            this.listBox1.Items.Add("PortId = " + snotify.PortId.ToString());
            this.listBox1.Items.Add("PortName = " + snotify.PortName);
            this.listBox1.Items.Add("Type = " + snotify.PortDeviceType);
            this.listBox1.Items.Add("PortStateId = " + snotify.PortStateId.ToString());
            this.listBox1.Items.Add("PortStateName = " + snotify.PortStateName);
        }
    }
}
[VB.NET]
Imports Honeywell.Mobility.DataCollection
Public Class BarcodeReader
    Private WithEvents bcr As Honeywell.Mobility.DataCollection.BarcodeReader

    Private Sub BarcodeReader_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            bcr = New Honeywell.Mobility.DataCollection.BarcodeReader()
        Catch bcrexp As BarcodeReaderException
            MessageBox.Show(bcrexp.Message)
        End Try
    End Sub

    Private Sub bcr_ScannerNotify(ByVal sender As Object, ByVal snotify As Honeywell.Mobility.DataCollection.ScannerNotifyEventArgs) Handles bcr.ScannerNotify
        ListBox1.Items.Add("PortId = " + snotify.PortId.ToString())
        ListBox1.Items.Add("PortName = " + snotify.PortName)
        ListBox1.Items.Add("Type = " + snotify.PortDeviceType)
        ListBox1.Items.Add("PortStateId = " + snotify.PortStateId.ToString())
        ListBox1.Items.Add("PortStateName = " + snotify.PortStateName)

    End Sub
End Class

More Information

BarcodeReader Class