コード例 #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();
     });
 }
コード例 #2
0
 // 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);
     }
 }
コード例 #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();
     });
 }
コード例 #4
0
 // 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);
     }
 }
コード例 #5
0
 // a scanner has disconnected from the host
 public void OnDeviceRemoval(ScanApiHelper.DeviceInfo deviceRemoved)
 {
     connectedDevice = null;
     UpdateStatusText("Scanner Removed: " + deviceRemoved.Name);
 }
コード例 #6
0
 // some decoded data have been received
 public void OnDecodedData(ScanApiHelper.DeviceInfo device, ISktScanDecodedData decodedData)
 {
     UpdateDecodedDataText(decodedData.DataToUTF8String);
 }
コード例 #7
0
 // some decoded data have been received
 public void OnDecodedData(ScanApiHelper.DeviceInfo device, ISktScanDecodedData decodedData)
 {
 }