ClaimedBarcodeScanner.EnableAsync 方法

定义

获取 DataReceived 事件的条形码扫描仪进入就绪状态。

public:
 virtual IAsyncAction ^ EnableAsync() = EnableAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction EnableAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction EnableAsync();
function enableAsync()
Public Function EnableAsync () As IAsyncAction

返回

此方法完成后,不会返回任何对象或值。

属性

示例

// Enables the barcode scanner to receive data.
task<void> Scenario1::EnableScanner()
{
    return create_task(claimedScanner->EnableAsync()).then([this](void)
    {
        // UpdateOutput("Barcode scanner enabled successfully.");
    });
}	
// Enables the barcode scanner to receive data 

private async Task<bool> EnableScanner()
{
    if (claimedScanner == null)
    {
        return false;   
    }
    else
    {   
        await claimedScanner.EnableAsync();
      
        return true;
    }            
}

适用于