private BarcodeFormat XamBarcodeFormatToAndroid(XamBarcodeFormat barcodeFormat) { int targetFormat = (int)XamBarcodeFormat.Deafult; if (((int)barcodeFormat & (int)XamBarcodeFormat.Code128) == (int)XamBarcodeFormat.Code128) { targetFormat |= (int)BarcodeFormat.Code128; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Code39) == (int)XamBarcodeFormat.Code39) { targetFormat |= (int)BarcodeFormat.Code39; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Code93) == (int)XamBarcodeFormat.Code93) { targetFormat |= (int)BarcodeFormat.Code93; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Codabar) == (int)XamBarcodeFormat.Codabar) { targetFormat |= (int)BarcodeFormat.Codabar; } if (((int)barcodeFormat & (int)XamBarcodeFormat.DataMatrix) == (int)XamBarcodeFormat.DataMatrix) { targetFormat |= (int)BarcodeFormat.DataMatrix; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Ean13) == (int)XamBarcodeFormat.Ean13) { targetFormat |= (int)BarcodeFormat.Ean13; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Ean8) == (int)XamBarcodeFormat.Ean8) { targetFormat |= (int)BarcodeFormat.Ean8; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Itf) == (int)XamBarcodeFormat.Itf) { targetFormat |= (int)BarcodeFormat.Itf; } if (((int)barcodeFormat & (int)XamBarcodeFormat.QrCode) == (int)XamBarcodeFormat.QrCode) { targetFormat |= (int)BarcodeFormat.QrCode; } if (((int)barcodeFormat & (int)XamBarcodeFormat.UpcA) == (int)XamBarcodeFormat.UpcA) { targetFormat |= (int)BarcodeFormat.UpcA; } if (((int)barcodeFormat & (int)XamBarcodeFormat.UpcE) == (int)XamBarcodeFormat.UpcE) { targetFormat |= (int)BarcodeFormat.UpcE; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Pdf417) == (int)XamBarcodeFormat.Pdf417) { targetFormat |= (int)BarcodeFormat.Pdf417; } if (((int)barcodeFormat & (int)XamBarcodeFormat.Aztec) == (int)XamBarcodeFormat.Aztec) { targetFormat |= (int)BarcodeFormat.Aztec; } return((BarcodeFormat)targetFormat); }
private AVMetadataObjectType XamBarcodeFormatToIos(XamBarcodeFormat barcodeFormat) { AVMetadataObjectType targetFormat = AVMetadataObjectType.None; if ((barcodeFormat & XamBarcodeFormat.Code128) == XamBarcodeFormat.Code128) { targetFormat |= AVMetadataObjectType.Code128Code; } if ((barcodeFormat & XamBarcodeFormat.Code39) == XamBarcodeFormat.Code39) { targetFormat |= AVMetadataObjectType.Code39Code; } if ((barcodeFormat & XamBarcodeFormat.Code93) == XamBarcodeFormat.Code93) { targetFormat |= AVMetadataObjectType.Code93Code; } if ((barcodeFormat & XamBarcodeFormat.DataMatrix) == XamBarcodeFormat.DataMatrix) { targetFormat |= AVMetadataObjectType.DataMatrixCode; } if ((barcodeFormat & XamBarcodeFormat.Ean13) == XamBarcodeFormat.Ean13) { targetFormat |= AVMetadataObjectType.EAN13Code; } if ((barcodeFormat & XamBarcodeFormat.Ean8) == XamBarcodeFormat.Ean8) { targetFormat |= AVMetadataObjectType.EAN8Code; } if ((barcodeFormat & XamBarcodeFormat.Itf) == XamBarcodeFormat.Itf) { targetFormat |= AVMetadataObjectType.ITF14Code; } if ((barcodeFormat & XamBarcodeFormat.QrCode) == XamBarcodeFormat.QrCode) { targetFormat |= AVMetadataObjectType.QRCode; } if ((barcodeFormat & XamBarcodeFormat.UpcE) == XamBarcodeFormat.UpcE) { targetFormat |= AVMetadataObjectType.UPCECode; } if ((barcodeFormat & XamBarcodeFormat.Pdf417) == XamBarcodeFormat.Pdf417) { targetFormat |= AVMetadataObjectType.PDF417Code; } if ((barcodeFormat & XamBarcodeFormat.Aztec) == XamBarcodeFormat.Aztec) { targetFormat |= AVMetadataObjectType.AztecCode; } return(targetFormat); }
public BarcodeScanView(XamBarcodeFormat barcodeFormat = XamBarcodeFormat.Deafult) { BarcodeFormat = barcodeFormat; }