/// ************************************************************************************************ /// <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(); }
/// ************************************************************************************************ /// <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(); }