Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 禁用Linea Pro 5扫描仪,无需呼叫断开连接_C#_Ios_Xamarin.ios_Xamarin_Linea Pro - Fatal编程技术网

C# 禁用Linea Pro 5扫描仪,无需呼叫断开连接

C# 禁用Linea Pro 5扫描仪,无需呼叫断开连接,c#,ios,xamarin.ios,xamarin,linea-pro,C#,Ios,Xamarin.ios,Xamarin,Linea Pro,我正在将Linea Pro 5与iPod Touch 5配合使用。 我在C#中的Xamarin下开发iOS应用程序,在VS 2012下 我的情况是这样的: 我的iOS应用程序中有A屏和B屏。 在屏幕A中,我想允许用户扫描条形码,但当他移动到屏幕B时,我想禁用扫描仪。 也就是说,我想选择只扫描一个屏幕(屏幕A) 以下是我所做的: 我的Linea设备被声明为类类型为“Linea”的变量“lineaDevice”。 我尝试在屏幕A中执行(当屏幕加载时): line设备。Connect(); 在屏幕B中

我正在将Linea Pro 5与iPod Touch 5配合使用。 我在C#中的Xamarin下开发iOS应用程序,在VS 2012下

我的情况是这样的: 我的iOS应用程序中有A屏和B屏。 在屏幕A中,我想允许用户扫描条形码,但当他移动到屏幕B时,我想禁用扫描仪。 也就是说,我想选择只扫描一个屏幕(屏幕A)

以下是我所做的: 我的Linea设备被声明为类类型为“Linea”的变量“lineaDevice”。 我尝试在屏幕A中执行(当屏幕加载时): line设备。Connect(); 在屏幕B中(当屏幕加载时): 线性设备。断开连接()

这是可行的,扫描仪在屏幕B中不起作用(红灯甚至没有打开),但是,这种方法的问题是每次调用lineaDevice.Connect();,只需第二次单击Linea设备的物理按钮,即可打开设备(及其红灯)进行扫描。也就是说,当用户移回屏幕A时,他必须在物理按钮上单击两次才能开始扫描

我希望它在第一次扫描时总是“平滑”的

请让我知道在其他屏幕中“禁用”Linea的任何想法。这意味着,当单击物理Linea按钮时,其他屏幕中不会发生任何情况,但在用户返回屏幕A(必须连接Linea)的那一刻,它仍将处于连接状态


提前谢谢

设置CanButtonMode

NSPortTimeoutException - if there is no connection to Linea
NSInvalidArgumentException if some of the input parameters are wrong
设置Linea的扫描按钮模式。 此设置不是永久性的,最好在连接时进行配置

Syntax
-(void)setScanButtonMode:(int)mode;
参数模式,

BUTTON_DISABLED - Linea's button will become inactive
BUTTON_ENABLED - Linea's button will triger barcode scan when pressed
返回值

NSPortTimeoutException - if there is no connection to Linea
NSInvalidArgumentException if some of the input parameters are wrong
希望这对你有帮助