public void GetSummaryButton_Click(object sender, RoutedEventArgs e) { BatchSetupView.ShowLoadingBar(Visibility.Hidden); try { Measurements.Clear(); string machineName = this.GetDbMachineName(); string connectionString = this.GetEfConnectionString(); if (string.IsNullOrEmpty(connectionString)) { MessageBox.Show("no connection string"); return; } this.Measurements = new ObservableCollection <IdNamePairProcessItem>(); _machineName = machineName; _connectionString = connectionString; using (BusyCursor busyCursor = new BusyCursor()) { this.PopulateTree(); } //_backgroundWorker = new BackgroundWorker(); //_backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWork_DoWork); //_backgroundWorker.WorkerReportsProgress = true; ////_backgroundWorker.WorkerSupportsCancellation = true; //_backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged); //_backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted); //_backgroundWorker.RunWorkerAsync(); } catch (Exception ex) { } }
private void AddPrinter(Printer printer) { DialogResult result; using (var bc = new BusyCursor()) { using (PrinterEditForm form = new PrinterEditForm(printer)) { result = form.ShowDialog(); if (result == DialogResult.OK) { RefreshItems(); } } } }
private DialogResult EditPrinter(string printerId) { DialogResult result; using (var bc = new BusyCursor()) { using (PrinterEditForm form = new PrinterEditForm(printerId)) { result = form.ShowDialog(); if (result == DialogResult.OK) { _bindingSource.ResetBindings(false); } } } return(result); }
public void Execute(object parameter) { if (_setBusyCursor) { BusyCursor.Start(); } try { _execute(parameter); } finally { if (_setBusyCursor) { BusyCursor.Stop(); } } }
private void edit_ToolButton_Click(object sender, EventArgs e) { if (radGrid_Devices.SelectedRows.Count == 1) { MobileDevice selectedDevice = GetFirstSelectedDataItem(); using (BusyCursor bc = new BusyCursor()) { using (MobileDeviceEditForm form = new MobileDeviceEditForm(selectedDevice.AssetId)) { if (form.ShowDialog() == DialogResult.OK) { RefreshItems(); } } } } }
private void edit_Button_Click(object sender, EventArgs e) { if (radGridViewCameras.SelectedRows.Count == 1) { Camera selectedCamera = radGridViewCameras.SelectedRows[0].DataBoundItem as Camera; using (var bc = new BusyCursor()) { using (CameraEditForm form = new CameraEditForm(selectedCamera.AssetId)) { if (form.ShowDialog() == DialogResult.OK) { RefreshItems(); } } } } }
public async void Execute(object parameter) { if (_setBusyCursor) { BusyCursor.Start(); } try { await _execute(parameter); CommandManager.InvalidateRequerySuggested(); } finally { if (_setBusyCursor) { BusyCursor.Stop(); } } }
public void ShowBusyIndicatorUntilFinishDrawing() { BusyCursor.DisplayUntilIdle(); }
public void ShowBusyIndicator(Action action) { using (BusyCursor.Display()) action(); }