예제 #1
0
        public BrightnessMonitor()
        {
            currentInstance = WMITool.GetDisplayInstance();

            prevBrightness = WMITool.GetBrightness();
            prevState      = WMITool.GetBatteryState();
        }
예제 #2
0
        public void BrightnessTick(int currBrightness)
        {
            int currState = WMITool.GetBatteryState();

            if (currState != prevState)
            {
                WMITool.SetBrightness(currentInstance, prevBrightness);
                BrightnessChanged?.Invoke(prevBrightness);
            }

            prevState      = currState;
            prevBrightness = currBrightness;
        }