Ejemplo n.º 1
0
 // By default, use all connections types.
 public static async Task <PosPrinter> GetFirstReceiptPrinterAsync(PosConnectionTypes connectionTypes = PosConnectionTypes.All)
 {
     return(await DeviceHelpers.GetFirstDeviceAsync(PosPrinter.GetDeviceSelector(connectionTypes),
                                                    async (id) =>
     {
         PosPrinter printer = await PosPrinter.FromIdAsync(id);
         if (printer != null && printer.Capabilities.Receipt.IsPrinterPresent)
         {
             return printer;
         }
         // Dispose the unwanted printer.
         printer?.Dispose();
         return null;
     }));
 }
 public static async Task <BarcodeScanner> GetFirstBarcodeScannerAsync(PosConnectionTypes connectionTypes = PosConnectionTypes.All)
 {
     return(await DeviceHelpers.GetFirstDeviceAsync(BarcodeScanner.GetDeviceSelector(connectionTypes), async (id) => await BarcodeScanner.FromIdAsync(id)));
 }
Ejemplo n.º 3
0
 // By default, use all connections types.
 public static async Task <CashDrawer> GetFirstCashDrawerAsync(PosConnectionTypes connectionTypes = PosConnectionTypes.All)
 {
     return(await DeviceHelpers.GetFirstDeviceAsync(CashDrawer.GetDeviceSelector(connectionTypes), async (id) => await CashDrawer.FromIdAsync(id)));
 }
 // By default, use all connections types.
 public static async Task <MagneticStripeReader> GetFirstMagneticStripeReaderAsync(PosConnectionTypes connectionTypes = PosConnectionTypes.All)
 {
     return(await DeviceHelpers.GetFirstDeviceAsync(MagneticStripeReader.GetDeviceSelector(connectionTypes), async (id) => await MagneticStripeReader.FromIdAsync(id)));
 }