コード例 #1
0
 public void Cancel()
 {
     Canceled.Reset();
     _backgroundProcessor.CancelAsync();
     Canceled.WaitOne();
     Done.Reset();
     Canceled.Reset();
 }
コード例 #2
0
        public void RunAsync(Config config)
        {
            Done.Reset();
            Canceled.Reset();

            if (_processor.SamplesCount < 2)
            {
                throw new InvalidOperationException(string.Format("Minimum two samples are required; {0} is given.", _processor.SamplesCount));
            }

            if (_backgroundProcessor.IsBusy)
            {
                Cancel();
            }
            _backgroundProcessor.RunWorkerAsync(config);
        }