private void btn_ClearBarcode_Click(object sender, RoutedEventArgs e) { if (ServiceProvider.DeviceManager.SelectedCameraDevice == null) { Dispatcher.BeginInvoke(new Action(delegate { Barcode = ""; txt_Barcode.Text = ""; CheckBarcode(); txt_Barcode.Focus(); })); return; } Dispatcher.BeginInvoke(new Action(delegate { if (BarcodeClearDisplay == null || !BarcodeClearDisplay.IsVisible) { BarcodeClearDisplay = new CameraControl.Plugins.windows.DialogPrompt("Ensuring transfers have completed...\nThis window will close automatically."); BarcodeClearDisplay.Show(); BarcodeClearTimer = new System.Windows.Threading.DispatcherTimer(); BarcodeClearTimer.Interval = new TimeSpan(0, 0, 1); BarcodeClearTimer.Tick += on_BarcodeClearTimer_Tick; BarcodeClearTimer.Start(); } })); }
public void ShowWarning(string msg) { Dispatcher.BeginInvoke(new Action(delegate { FlashScreen(-1); var prompt = new CameraControl.Plugins.windows.DialogPrompt(msg); prompt.ShowDialog(); FlashScreenStop(); })); }
private void on_txt_Barcode_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) { if (ServiceProvider.DeviceManager.SelectedCameraDevice != null && ServiceProvider.DeviceManager.SelectedCameraDevice.IsBusy) { Dispatcher.BeginInvoke(new Action(delegate { var prompt = new CameraControl.Plugins.windows.DialogPrompt("Should not clear barcode: transfers still pending."); prompt.ShowDialog(); })); return; } Barcode = txt_Barcode.Text; // Expedite update BarcodeUsed = false; CheckBarcode(); }