Fractrace.Iterate.Wait C# (CSharp) Method

Wait() public method

Wait till async computation ends.
public Wait ( ) : void
return void
        public void Wait()
        {
            while (_start && !_abort)
            {
                System.Windows.Forms.Application.DoEvents();
                System.Threading.Thread.Sleep(100);
            }
        }

Usage Example

Example #1
0
 /// <summary>
 /// Start Computing. Is called while rendering an animation. 
 /// </summary>
 public void Run(int updateSteps)
 {
     _currentProgress = 0;
     _master.Progress(_currentProgress);
     System.Diagnostics.Debug.WriteLine("PaintJob.Run " + updateSteps.ToString());
     _parameters = ParameterDict.Current.Clone();
     _updateSteps = updateSteps;
     _currentProgressd = 100.0 / (double)(_updateSteps);
     for (int i = 0; i < _updateSteps; i++)
     {
         if (_abort)
             return;
         _iterate = new Iterate(_parameters, this, false);
         if (_lastIterate != null)
         {
             _iterate.SetOldData(_lastIterate.GraphicInfo,_lastIterate.PictureData,i);
         }
         if (_abort)
             return;
         _iterate.StartAsync();
         _iterate.Wait();
         if (_abort)
             return;
         _lastIterate = _iterate;
         _currentProgress += _currentProgressd;
         _master.Progress(_currentProgress);
     }
     Renderer renderer = PictureArtFactory.Create(_iterate.PictureData, _iterate.LastUsedFormulas);
     renderer.Paint(_graphics);
     if (_abort)
         return;
     _master.Progress(0);
 }