// ---------------------------------------------------------------------------------
 /// Stops the repaint time.
 void StopRepaintTimer()
 {
     if (ourRepaintTimer != null)
     {
         ourRepaintTimer.Stop();
         ourRepaintTimer = null;
     }
 }
 static void ImmediateSaveWithUndo()
 {
     if (mySaveTimer.IsElapsed)
     {
         return;
     }
     mySaveTimer.Stop();
     PerformSaveWithUndo();
 }
 // =======================================================================
 // Utilities
 // -----------------------------------------------------------------------
 void UpdateErrorRepaintTimer()
 {
     if (!ErrorController.IsErrorOrWarning)
     {
         if (ourErrorRepaintTimer != null)
         {
             ourErrorRepaintTimer.Stop();
         }
     }
     else
     {
         if (ourErrorRepaintTimer == null)
         {
             ourErrorRepaintTimer = TimerService.CreateTimedAction(0.06f, Repaint, /*isLooping=*/ true);
         }
         else if (ourErrorRepaintTimer.IsElapsed)
         {
             ourErrorRepaintTimer.Restart();
         }
     }
 }