예제 #1
0
        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)
            {
            }
        }
예제 #2
0
        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();
                    }
                }
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
 public void Execute(object parameter)
 {
     if (_setBusyCursor)
     {
         BusyCursor.Start();
     }
     try
     {
         _execute(parameter);
     }
     finally
     {
         if (_setBusyCursor)
         {
             BusyCursor.Stop();
         }
     }
 }
예제 #5
0
        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();
                        }
                    }
                }
            }
        }
예제 #6
0
        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();
                        }
                    }
                }
            }
        }
예제 #7
0
        public async void Execute(object parameter)
        {
            if (_setBusyCursor)
            {
                BusyCursor.Start();
            }
            try
            {
                await _execute(parameter);

                CommandManager.InvalidateRequerySuggested();
            }
            finally
            {
                if (_setBusyCursor)
                {
                    BusyCursor.Stop();
                }
            }
        }
예제 #8
0
파일: BusyService.cs 프로젝트: megahirt/cog
 public void ShowBusyIndicatorUntilFinishDrawing()
 {
     BusyCursor.DisplayUntilIdle();
 }
예제 #9
0
파일: BusyService.cs 프로젝트: megahirt/cog
 public void ShowBusyIndicator(Action action)
 {
     using (BusyCursor.Display())
         action();
 }