ClaimedBarcodeScanner.EnableAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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;
}
}