Пример #1
0
        protected override void SetKeepScreenOn(bool keepScreenOn)
        {
            if (KeepScreenOn == value)
            {
                return;
            }

            if (keepScreenOn)
            {
                IOKit.PreventUserIdleDisplaySleep("KeepScreenOn", out keepScreenOnId);
            }
            else
            {
                if (IOKit.AllowUserIdleDisplaySleep(keepScreenOnId))
                {
                    keepScreenOnId = 0;
                }
            }
        }
Пример #2
0
 partial void ActivateScreenLock()
 {
     IOKit.PreventUserIdleDisplaySleep("DisplayRequest", out _displayRequestId);
 }