Ejemplo n.º 1
0
 public void Clear(bool waitForReset = true)
 {
     _dataSource.ClearData();
     _currentEffects.Reset();
     if (waitForReset)
     {
         while (_currentEffects.Resetting())
         {
             //wait for reset to occur.
         }
     }
 }
Ejemplo n.º 2
0
 public void Clear(bool waitForReset = true)
 {
     _dataSource.ClearData();
     if (!IsRunning || IsPaused)
     {
         Logging.Error("Attempt to clear effects from a non running context");
         return;
     }
     CurrentEffects.Reset();
     if (waitForReset)
     {
         //wait for reset to occur, but time out if it does not happen
         var sw = Stopwatch.StartNew();
         while (CurrentEffects.Resetting())
         {
             if (sw.ElapsedMilliseconds > 1000)
             {
                 Logging.Error("Attempt to clear current effects timed out after 1 second.");
                 break;
             }
         }
     }
 }