private void CancelScan() { if (radioButton5.Checked) { _scans.CancelRepetition(); } else if (radioButton6.Checked) { _scans.CancelCustomScan(); } }
/// <summary> /// Cancel an outstanding repetition scan. /// </summary> /// <param name="access">used to get access to the needed IScans interface.</param> static internal void CancelRepeatingScan(IExactiveInstrumentAccess access) { try { using (IScans scans = access.Control.GetScans(false)) { if (!scans.CancelRepetition()) { Console.WriteLine("CANCELLATION OF THE REPETITION SCAN HAS NOT BEEN PERFORMED, CONNECTION TO SERVICE BROKEN."); } } } catch (Exception e) { Console.WriteLine("CANCELING A REPETITION SCAN: " + e.Message); } }