//Ct50 code public void OnCreated(AidcManager aidcManager) { bool issuccessful = false; manager = aidcManager; // use the manager to create a BarcodeReader with a session // associated with the internal imager. try { reader = manager.CreateBarcodeReader(); issuccessful = true; } catch (Exception exc) { issuccessful = false; } if (issuccessful) { try { // apply settings reader.SetProperty(BarcodeReader.PropertyCode39Enabled, true); reader.SetProperty(BarcodeReader.PropertyDatamatrixEnabled, true); reader.SetProperty(BarcodeReader.PropertyCode128Enabled, true); reader.SetProperty(BarcodeReader.PropertyGs1128Enabled, true); reader.SetProperty(BarcodeReader.PropertyQrCodeEnabled, true); reader.SetProperty(BarcodeReader.PropertyUpcAEnable, true); reader.SetProperty(BarcodeReader.PropertyEan13Enabled, true); reader.SetProperty(BarcodeReader.PropertyAztecEnabled, true); reader.SetProperty(BarcodeReader.PropertyCodabarEnabled, true); reader.SetProperty(BarcodeReader.PropertyInterleaved25Enabled, true); reader.SetProperty(BarcodeReader.PropertyPdf417Enabled, true); // Set Max Code 39 barcode length reader.SetProperty(BarcodeReader.PropertyCode39MaximumLength, 10); // Disable bad read response, handle in onFailureEvent reader.SetProperty(BarcodeReader.PropertyNotificationBadReadEnabled, true); // set the trigger mode to client control reader.SetProperty(BarcodeReader.PropertyTriggerControlMode, BarcodeReader.TriggerControlModeClientControl); } catch (UnsupportedPropertyException) { Toast.MakeText(this, "Failed to apply properties", ToastLength.Short).Show(); } // register bar code event listener reader.AddBarcodeListener(this as BarcodeReader.IBarcodeListener); // register trigger state change listener reader.AddTriggerListener(this as BarcodeReader.ITriggerListener); reader.Claim(); } }
public void OnCreated(AidcManager aidcManager) { _aidcManager = aidcManager; BarcodeReader = _aidcManager.CreateBarcodeReader(); }