예제 #1
0
        /// <summary>
        /// The work handler function for the background worker.  Displays
        /// the calibration form as a dialog
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            var worker = sender as Worker;

            calibrationForm = new CalibrationForm
            {
                Caption         = worker.Caption,
                Prompt          = worker.Prompt,
                SourceActuator  = SourceActuator,
                Timeout         = worker.Timeout,
                EnableConfigure = worker.EnableConfigure
            };

            Windows.SetWindowPosition(calibrationForm, worker.Position);
            _formCreatedEvent.Set();
            calibrationForm.ShowDialog();
            calibrationForm.Dispose();
        }
예제 #2
0
        /// <summary>
        /// Closes the calibration form
        /// </summary>
        private void closeCalibrationForm()
        {
            try
            {
                if (calibrationForm != null)
                {
                    calibrationForm.Dismiss();
                    calibrationForm = null;
                }

                if (_bgWorker != null)
                {
                    _bgWorker.CancelAsync();
                    _bgWorker.Dispose();
                    _bgWorker = null;
                }
            }
            catch
            {
            }
        }
예제 #3
0
파일: ActuatorEx.cs 프로젝트: zezo010/acat
        /// <summary>
        /// The work handler function for the background worker.  Displays
        /// the calibration form as a dialog
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            var worker = sender as Worker;

            calibrationForm = new CalibrationForm
            {
                Caption         = worker.Caption,
                Prompt          = worker.Prompt,
                SourceActuator  = SourceActuator,
                Timeout         = worker.Timeout,
                EnableConfigure = worker.EnableConfigure,
                ButtonText      = worker.ButtonText
            };

            Windows.SetWindowPosition(calibrationForm, worker.Position);
            _formCreatedEvent.Set();
            if (calibrationForm != null)
            {
                Log.Debug("Calling calibrationform.ShowDialog");
                DialogResult result = calibrationForm.ShowDialog();
                Log.Debug("Result: " + result);

                // user closed the calibration form
                if (result == DialogResult.Cancel)
                {
                    SourceActuator.OnCalibrationCanceled();
                    _calibrationDoneEvent.Set();
                }
            }
            else
            {
                Log.Debug("calibration form IS NULL!!!");
            }

            if (calibrationForm != null)
            {
                calibrationForm.Dispose();
                calibrationForm = null;
            }
        }
예제 #4
0
파일: ActuatorEx.cs 프로젝트: zezo010/acat
        /// <summary>
        /// Closes the calibration form
        /// </summary>
        private void closeCalibrationForm()
        {
            try
            {
                if (calibrationForm != null)
                {
                    Log.Debug("Closing calibration form, calling Dismiss()");
                    calibrationForm.Dismiss();
                    calibrationForm = null;
                }

                if (_bgWorker != null)
                {
                    _bgWorker.CancelAsync();
                    _bgWorker.Dispose();
                    _bgWorker = null;
                }
            }
            catch
            {
            }
        }
예제 #5
0
파일: ActuatorEx.cs 프로젝트: glwu/acat
        /// <summary>
        /// Closes the calibration form
        /// </summary>
        private void closeCalibrationForm()
        {
            try
            {
                if (calibrationForm != null)
                {
                    calibrationForm.Dismiss();
                    calibrationForm = null;
                }

                if (_bgWorker != null)
                {
                    _bgWorker.CancelAsync();
                    _bgWorker.Dispose();
                    _bgWorker = null;
                }
            }
            catch
            {
            }
        }
예제 #6
0
파일: ActuatorEx.cs 프로젝트: glwu/acat
        /// <summary>
        /// The work handler function for the background worker.  Displays
        /// the calibration form as a dialog
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            var worker = sender as Worker;
            calibrationForm = new CalibrationForm
            {
                Caption = worker.Caption,
                Prompt = worker.Prompt,
                SourceActuator = SourceActuator,
                Timeout = worker.Timeout,
                EnableConfigure = worker.EnableConfigure
            };

            Windows.SetWindowPosition(calibrationForm, worker.Position);
            _formCreatedEvent.Set();
            calibrationForm.ShowDialog();
            calibrationForm.Dispose();
        }