예제 #1
0
        public override bool UpdateBrightness(int brightness = -1)
        {
            if (_isRemovable)
            {
                this.Brightness = (0 <= brightness)
                                        ? brightness
                                        : MSMonitor.GetBrightness(DeviceInstanceId);
            }
            else
            {
                this.Brightness = PowerManagement.GetActiveSchemeBrightness();

                this.BrightnessSystemAdjusted = !PowerManagement.IsAdaptiveBrightnessEnabled
                                        ? -1 // Default
                                        : (0 <= brightness)
                                                ? brightness
                                                : MSMonitor.GetBrightness(DeviceInstanceId);
            }
            return(0 <= this.Brightness);
        }
예제 #2
0
        public override AccessResult UpdateBrightness(int brightness = -1)
        {
            if (_isInternal)
            {
                this.Brightness = PowerManagement.GetActiveSchemeBrightness();

                this.BrightnessSystemAdjusted = !PowerManagement.IsAdaptiveBrightnessEnabled
                                        ? -1 // Default
                                        : (0 <= brightness)
                                                ? brightness
                                                : MSMonitor.GetBrightness(DeviceInstanceId);
            }
            else
            {
                this.Brightness = (0 <= brightness)
                                        ? brightness
                                        : MSMonitor.GetBrightness(DeviceInstanceId);
            }
            return((0 <= this.Brightness) ? AccessResult.Succeeded : AccessResult.Failed);
        }
예제 #3
0
        public override bool UpdateBrightness(int brightness = -1)
        {
            lock (_lock)
            {
                if (_isRemovable)
                {
                    this.Brightness = (0 <= brightness)
                                                ? brightness
                                                : MSMonitor.GetBrightness(DeviceInstanceId);
                }
                else
                {
                    this.Brightness = PowerManagement.GetActiveSchemeBrightness();

                    if (LightSensor.AmbientLightSensorExists)
                    {
                        this.BrightnessSystemAdjusted = (0 <= brightness)
                                                        ? brightness
                                                        : MSMonitor.GetBrightness(DeviceInstanceId);
                    }
                }
                return(0 <= this.Brightness);
            }
        }