예제 #1
0
 /// ************************************************************************************************
 /// <summary>
 /// Disable screensaver and sleep
 /// </summary>
 /// <param name="isScreenSaverEnabled">System screensaver status</param>
 private void DisableScreenSaver(bool isScreenSaverEnabled)
 {
     if (isScreenSaverEnabled)
     {
         ScreenSaver.SetScreenSaverActive(false);
     }
     ScreenSaver.DisableSleep();
 }
예제 #2
0
 /// ************************************************************************************************
 /// <summary>
 /// Enable screensaver and sleep
 /// </summary>
 /// <param name="isScreenSaverEnabled">System screensaver status</param>
 private void EnableScreenSaver(bool isScreenSaverEnabled)
 {
     // if screen saver was enabled before app was started turn it on back
     if (isScreenSaverEnabled)
     {
         ScreenSaver.SetScreenSaverActive(true);
     }
     ScreenSaver.EnableSleep();
 }