Ejemplo n.º 1
0
 public SocketScannerHelper()
 {
     if (MonoTouch.ObjCRuntime.Runtime.Arch == MonoTouch.ObjCRuntime.Arch.SIMULATOR)
         return;
     ScanApi = new ScanApiHelper ();
     ScanApi.Delegate = new ScanDelegate (this);
     ScanApi.Open ();
     timer = NSTimer.CreateRepeatingScheduledTimer (.2, () => {
         var r = ScanApi.DoScanApiReceive();
     });
 }
 // a scanner has connected to the host
 public void OnDeviceArrival(long result, ScanApiHelper.DeviceInfo newDevice)
 {
     if (SktScanErrors.SKTSUCCESS(result))
     {
         UpdateStatusText("New Scanner: " + newDevice.Name);
         connectedDevice = newDevice;
     }
     else
     {
         string strMsg = String.Format("Unable to open scanner, error = %d.", result);
         MessageBox.Show(strMsg, "SingleEntry", MessageBoxButtons.OK, MessageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);
     }
 }
Ejemplo n.º 3
0
 public SocketScannerHelper()
 {
     if (MonoTouch.ObjCRuntime.Runtime.Arch == MonoTouch.ObjCRuntime.Arch.SIMULATOR)
     {
         return;
     }
     ScanApi          = new ScanApiHelper();
     ScanApi.Delegate = new ScanDelegate(this);
     ScanApi.Open();
     timer = NSTimer.CreateRepeatingScheduledTimer(.2, () => {
         var r = ScanApi.DoScanApiReceive();
     });
 }
 // a scanner has connected to the host
 public void OnDeviceArrival(long result, ScanApiHelper.DeviceInfo newDevice)
 {
     if (SktScanErrors.SKTSUCCESS(result))
     {
         UpdateStatusText("New Scanner: " + newDevice.Name);
         _device = newDevice;
         _scanApiHelper.PostGetBtAddress(newDevice, OnGetBdAddress);
     }
     else
     {
         string strMsg = String.Format("Unable to open scanner, error = {0}.", result);
         MessageBox.Show(strMsg, StrOkBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
 // a scanner has disconnected from the host
 public void OnDeviceRemoval(ScanApiHelper.DeviceInfo deviceRemoved)
 {
     connectedDevice = null;
     UpdateStatusText("Scanner Removed: " + deviceRemoved.Name);
 }
 // some decoded data have been received
 public void OnDecodedData(ScanApiHelper.DeviceInfo device, ISktScanDecodedData decodedData)
 {
     UpdateDecodedDataText(decodedData.DataToUTF8String);
 }
 // some decoded data have been received
 public void OnDecodedData(ScanApiHelper.DeviceInfo device, ISktScanDecodedData decodedData)
 {
 }