Exemplo n.º 1
0
 void OnProgress(ChromCacheMinimizer.MinStatistics minStatistics)
 {
     lock (this)
     {
         CheckDisposed();
         bool updateUi = _minStatistics == null || _minStatistics.PercentComplete != minStatistics.PercentComplete;
         _minStatistics = minStatistics;
         if (ReferenceEquals(_dlg.StatisticsCollector, this))
         {
             if (updateUi && !_updatePending)
             {
                 //_updatePending = true;
                 try
                 {
                     _dlg.BeginInvoke(new Action(UpdateStatistics));
                 }
                 catch (Exception x)
                 {
                     throw new ObjectDisposedException(_dlg.GetType().FullName, x);
                 }
             }
         }
     }
     if (_longWaitBroker != null)
     {
         _longWaitBroker.ProgressValue = minStatistics.PercentComplete;
         if (_longWaitBroker.IsCanceled)
         {
             throw new ObjectDisposedException(GetType().FullName);
         }
     }
 }