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); }
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); }
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); } }