/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/LightSwitch/LightSwitchService/SettingsObserver.h
33 строки
779 B
Jaylyn Barbee
[Light Switch] Light Switch should detect changes in Windows Settings and treat as manual override (same as using shortcut) (#42882)
28 окт 2025, 22:00
Не верифицирован
28 окт 2025, 22:00
01fb831
Код
Авторство
О чём код?
#pragma once #include <unordered_set> #include "SettingsConstants.h" #include "LightSwitchSettings.h" class LightSwitchSettings; class SettingsObserver { public: SettingsObserver(std::unordered_set<SettingId> observedSettings) : m_observedSettings(std::move(observedSettings)) { LightSwitchSettings::instance().AddObserver(*this); } virtual ~SettingsObserver() { LightSwitchSettings::instance().RemoveObserver(*this); } // Override this in your class to respond to updates virtual void SettingsUpdate(SettingId type) {} virtual bool WantsToBeNotified(SettingId type) const noexcept { return m_observedSettings.contains(type); } protected: std::unordered_set<SettingId> m_observedSettings; };