ClaimedBarcodeScanner.EnableAsync Method

Definition

Gets the barcode scanner into a ready state for DataReceived events.

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

Returns

No object or value is returned when this method completes.

Attributes

Examples

// 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;
    }            
}

Applies to