Esempio n. 1
0
        public static DisplayRequestInfo ReleaseDisplayRequest()
        {
            DisplayRequestInfo requestInfo = new DisplayRequestInfo();

            if (isDisplayRequestActive)
            {
                appDisplayRequest.RequestRelease();
                isDisplayRequestActive       = false;
                requestInfo.ActivationResult = ActivationResult.Released;
            }
            else
            {
                requestInfo.ActivationResult = ActivationResult.NotActivated;
            }
            return(requestInfo);
        }
Esempio n. 2
0
        public static DisplayRequestInfo ActivateDisplayRequest()
        {
            DisplayRequestInfo requestInfo = new DisplayRequestInfo();

            if (!isDisplayRequestActive)
            {
                if (appDisplayRequest == null)
                {
                    appDisplayRequest = new DisplayRequest();
                }
                appDisplayRequest.RequestActive();
                displayRequestActivationTime = DateTime.Now;
                isDisplayRequestActive       = true;
                requestInfo.ActivationResult = ActivationResult.Activated;
            }
            else
            {
                requestInfo.ActivationResult = ActivationResult.PreviouslyActivated;
            }
            requestInfo.ActivationTime = displayRequestActivationTime;
            return(requestInfo);
        }