Exemplo n.º 1
0
 private static void WakeUpScreenSaver()
 {
     if (ScreenSaverController.GetScreenSaverRunning())
     {
         Ex.Log("WakeUpScreenSaver() ScreenSaverRunning==true");
         ScreenSaverController.KillScreenSaver();
     }
 }
Exemplo n.º 2
0
        public static async Task CheckScreenSaver()
        {
            Ex.Log("SystemManager.CheckScreenSaver()");
            bool isScreensaverRuning;
            bool isDoneOnce = false;

            while (true)
            {
                isScreensaverRuning = ScreenSaverController.GetScreenSaverRunning();
                if (!isScreensaverRuning)
                {
                    isDoneOnce = false;
                }
                if (isScreensaverRuning && !isDoneOnce)
                {
                    OnScreenSaverDetected();
                    isDoneOnce = true;
                    await Task.Delay(30000);
                }
                await Task.Delay(2000);
            }
            Ex.Log("CheckScreenSaver() while(true) finished.");
        }