Exemplo n.º 1
0
        /// <summary>
        /// Handles the scan button click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
        /// <param name="navigate">if set to <c>true</c> [navigate].</param>
        public void HandleScanButtonClick(object sender, RoutedEventArgs e, bool navigate)
        {
            Button scanButton = sender as Button;

            if (ScanButtonText.IsStartScan(scanButton.Content as string))
            {
                if (ScannerFeederType.Equals(FeederType.SingleItem))
                {
                    rangerScanner.StartFeeding(FeedSource.FeedSourceManualDrop, FeedItemCount.FeedOne);
                }
                else
                {
                    rangerScanner.StartFeeding(FeedSource.FeedSourceMainHopper, FeedItemCount.FeedContinuously);
                }

                if (navigate)
                {
                    this.NavigationService.Navigate(ScanningPage);
                }
            }
            else
            {
                rangerScanner.StopFeeding();
                if (navigate)
                {
                    this.NavigationService.Navigate(this);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the Click event of the btnStartStop control (only applies to Ranger scanners)
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnStartStop_Click(object sender, RoutedEventArgs e)
 {
     if (batchPage.rangerScanner != null)
     {
         if (ScanButtonText.IsStartScan(btnStartStop.Content as string))
         {
             StartScanningRanger();
         }
         else
         {
             batchPage.rangerScanner.StopFeeding();
         }
     }
 }