Example #1
0
        public ScanForm(MainForm parent, MODE mode)
        {
            this.mode = mode;

            InitializeComponent();
            this.ParentForm = parent;

            setModeDependentLayout();

            // Initialize the ScanSampleAPI reference.
            this.myScanSampleAPI = new API();

            this.isReaderInitiated = this.myScanSampleAPI.InitReader();

            if (!(this.isReaderInitiated))// If the reader has not been initialized
            {
                // Display a message & exit the application.
                MessageBox.Show("Reader could not be initialized");
                Application.Exit();
            }
            else // If the reader has been initialized
            {

                // Attach a status natification handler.
                this.myStatusNotifyHandler = new EventHandler(myReader_StatusNotify);
                myScanSampleAPI.AttachStatusNotify(myStatusNotifyHandler);
            }

            //Enable reading
            // Start a read operation & attach a handler.
            myScanSampleAPI.StartRead(false);
            this.myReadNotifyHandler = new EventHandler(myReader_ReadNotify);
            myScanSampleAPI.AttachReadNotify(myReadNotifyHandler);
        }
 public LoginForm(MainForm parent)
 {
     this.ParentForm = parent;
     InitializeComponent();
 }