Ejemplo n.º 1
0
 /// <summary>
 /// Adds specified barcode symbologies to the barcode reader settings.
 /// </summary>
 /// <param name="barcodeSymbologies">The barcode symbologies.</param>
 private void AddBarcodesToScanBarcodes(BarcodeSymbology[] barcodeSymbologies)
 {
     foreach (BarcodeSymbology symbology in barcodeSymbologies)
     {
         BarcodeSymbologySubset symbologySubset = symbology as BarcodeSymbologySubset;
         if (symbologySubset != null)
         {
             if (!BarcodeReaderSettings.ScanBarcodeSubsets.Contains(symbologySubset))
             {
                 BarcodeReaderSettings.ScanBarcodeSubsets.Add(symbologySubset);
             }
         }
         else
         {
             BarcodeReaderSettings.ScanBarcodeTypes |= symbology.BarcodeType;
         }
     }
     UpdateBarcodeSymbologiesInScanBarcodeTypesListBox();
 }
        /// <summary>
        /// Adds specified barcode symbologies to the barcode reader settings.
        /// </summary>
        /// <param name="barcodeSymbologies">The barcode symbologies.</param>
        private void AddBarcodeSymbologiesToBarcodeReaderSettings(BarcodeSymbology[] barcodeSymbologies)
        {
            foreach (BarcodeSymbology symbology in barcodeSymbologies)
            {
                BarcodeSymbologySubset symbologySubset = symbology as BarcodeSymbologySubset;
                if (symbologySubset != null)
                {
                    if (!BarcodeReaderSettings.ScanBarcodeSubsets.Contains(symbologySubset))
                    {
                        BarcodeReaderSettings.ScanBarcodeSubsets.Add(symbologySubset);
                    }
                }
                else
                {
                    BarcodeReaderSettings.ScanBarcodeTypes |= symbology.BarcodeType;
                }
            }

            // update the barcode symbologies in the scanBarcodeTypesListBox
            UpdateBarcodeSymbologiesInScanBarcodeTypesListBox();
            OnSettingsChanged(EventArgs.Empty);
        }
 private void scanBarcodeTypesListBox_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     // if barcode symbology is selected
     if (scanBarcodeTypesListBox.SelectedItem != null)
     {
         // show information about barcode symbology
         BarcodeSymbology selectedBarcodeSymbology = (BarcodeSymbology)scanBarcodeTypesListBox.SelectedItem;
         StringBuilder    barcodeInfo = new StringBuilder();
         barcodeInfo.AppendLine(string.Format("Symbology name: {0}", selectedBarcodeSymbology));
         if (selectedBarcodeSymbology is BarcodeSymbologySubset)
         {
             barcodeInfo.AppendLine(string.Format("Base symbology type: {0}", selectedBarcodeSymbology.BarcodeType));
             BarcodeSymbologySubset selectedBarcodeSymbologySubset = (BarcodeSymbologySubset)selectedBarcodeSymbology;
             if (selectedBarcodeSymbologySubset.BaseSubset != null)
             {
                 barcodeInfo.AppendLine(string.Format("Base symbology subset: {0}", selectedBarcodeSymbologySubset.BaseSubset));
             }
         }
         barcodeInfo.AppendLine(string.Format("Attributes: {0}", selectedBarcodeSymbology.Attributes));
         MessageBox.Show(barcodeInfo.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }