コード例 #1
0
ファイル: ScanAPI.cs プロジェクト: Daliys/WindowsCE_Scanner
 public void DetachStatusNotify(Barcode2.OnStatusHandler statusNotifyHandler)
 {
     if (_myBarcode2 == null)
     {
         return;
     }
     _myBarcode2.OnStatus -= statusNotifyHandler;
 }
コード例 #2
0
ファイル: API.cs プロジェクト: OlehR/PriceChecker
 /// <summary>
 /// Detach a StatusNotify handler.
 /// </summary>
 public void DetachStatusNotify(Barcode2.OnStatusHandler StatusNotifyHandler)
 {
     // If we have a reader registered for receiving the status notifications
     if (myBarcode2 != null)
     {
         // Detach the status notification handler.
         myBarcode2.OnStatus -= StatusNotifyHandler;
     }
 }
コード例 #3
0
ファイル: API.cs プロジェクト: OlehR/PriceChecker
 /// <summary>
 /// Attach a StatusNotify handler.
 /// </summary>
 public void AttachStatusNotify(Barcode2.OnStatusHandler StatusNotifyHandler)
 {
     // If we have a reader
     if (myBarcode2 != null)
     {
         // Attach status notification handler.
         myBarcode2.OnStatus += StatusNotifyHandler;
     }
 }
コード例 #4
0
        private void SelectLocation_Form_Load(object sender, EventArgs e)
        {
            Cursor.Show();
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                // Initialize the ScanAPI reference.
                this.myScanAPI = new API();
                this.isBarcodeInitiated = this.myScanAPI.InitBarcode();

                if (!(this.isBarcodeInitiated))// If the Barcode object has not been initialized
                {
                    // Display a message & exit the application.
                    MessageBox.Show("Barcode not been initialized");
                    Application.Exit();
                }
                else // If the Barcode object has been initialized
                {
                    // Attach a scan notification handler.
                    this.myScanNotifyHandler = new Barcode2.OnScanHandler(barcode21_OnScan);
                    myScanAPI.AttachScanNotify(myScanNotifyHandler);

                    // Attach a status notification handler.
                    this.myStatusNotifyHandler = new Barcode2.OnStatusHandler(barcode21_OnStatus);
                    myScanAPI.AttachStatusNotify(myStatusNotifyHandler);
                }

                myFormActivatedEventHandler = new EventHandler(MainForm_Activated);
                myFormDeactivatedEventHandler = new EventHandler(MainForm_Deactivate);

                this.Activated += myFormActivatedEventHandler;
                this.Deactivate += myFormDeactivatedEventHandler;

                locTagID_TextBox.Text = GlobalVariables.Temp_LocationName;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Scan Inventory");
            }
            Cursor.Current = Cursors.Default;
        }