Exemple #1
0
        async System.Threading.Tasks.Task resetScanner()
        {
            if (_ClaimedBarcodeScanner != null)
            {
                if (_autoScan)
                {
                    await _ClaimedBarcodeScanner.StopSoftwareTriggerAsync();
                }
                _ClaimedBarcodeScanner.DataReceived           -= _ClaimedBarcodeScanner_DataReceived;
                _ClaimedBarcodeScanner.ReleaseDeviceRequested -= _ClaimedBarcodeScanner_ReleaseDeviceRequested;
                _ClaimedBarcodeScanner.Dispose();
                _ClaimedBarcodeScanner = null;
            }
            _BarcodeScanner = null;
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //UI code here
                textBox_Scan.Background = new SolidColorBrush(Windows.UI.Colors.White);
                textBox_Scan.Text       = "";
                textBox_Time.Text       = "";
                //play sound at end of Release
            });

            App.mySoundEffects.Play(AppSoundEffects.SoundEfxEnum.ComputerError);
        }
Exemple #2
0
 private async Task StopSoftwareTrigger()
 {
     if (scanner.Capabilities.IsSoftwareTriggerSupported)
     {
         await claimedScanner.StopSoftwareTriggerAsync();
     }
     // reset the trigger buttons' state
     //rootPage.NotifyUser("Stop Software Trigger", NotifyType.StatusMessage);
 }
Exemple #3
0
        /// <summary>
        /// Event Handler for Stop Software Trigger Button Click.
        /// Stops scanning.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void StopSoftwareTriggerButton_Click(object sender, RoutedEventArgs e)
        {
            if (claimedScanner != null)
            {
                await claimedScanner.StopSoftwareTriggerAsync();

                SoftwareTriggerStarted = false;
                RaisePropertyChanged(nameof(SoftwareTriggerStarted));
            }
        }
 private async void ScenarioStopSWTriggerButton_Click(object sender, RoutedEventArgs e)
 {
     if (scanner.Capabilities.IsSoftwareTriggerSupported)
     {
         await claimedScanner.StopSoftwareTriggerAsync();
     }
     // reset the trigger buttons' state
     ScenarioStartSWTriggerButton.IsEnabled = true;
     ScenarioStopSWTriggerButton.IsEnabled  = false;
     rootPage.NotifyUser("Stop Software Trigger", NotifyType.StatusMessage);
 }
        protected override async void OnNavigatedFrom(NavigationEventArgs e)
        {
            using (ExitLocker)
            {
                await Task.Run(() =>
                {
                    ExitLocker.WaitOne();
                });
            }

            if (Capture != null)
            {
                using (Capture)
                {
                    await Capture.StopPreviewAsync();

                    PreviewControl.Source = null;
                }
            }

            if (ClaimedScanner != null)
            {
                using (ClaimedScanner)
                {
                    await ClaimedScanner.StopSoftwareTriggerAsync();

                    await ClaimedScanner.DisableAsync();

                    ClaimedScanner.DataReceived -= ClaimedScanner_DataReceived;
                }
            }
            BarcodeHistory.Clear();
            BarcodeHistory = null;
            ExitLocker     = null;
            Capture        = null;
            ClaimedScanner = null;
        }