Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dev/PowerNotifications/PowerNotifications.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,12 @@ namespace winrt::Microsoft::Windows::System::Power
co_return res;
}

Power::EffectivePowerMode EffectivePowerMode2()
{
UpdateValuesIfNecessary(effectivePowerModeFunc);
return static_cast<Power::EffectivePowerMode>(m_cachedPowerMode);
}

event_token EffectivePowerModeChanged(const PowerEventHandler& handler)
{
return AddCallback(effectivePowerModeFunc, handler);
Expand Down Expand Up @@ -686,6 +692,11 @@ namespace winrt::Microsoft::Windows::System::Power
return Factory()->EffectivePowerMode();
}

static Power::EffectivePowerMode EffectivePowerMode2()
{
return Factory()->EffectivePowerMode2();
}

static Power::UserPresenceStatus UserPresenceStatus()
{
return Factory()->UserPresenceStatus();
Expand Down
1 change: 1 addition & 0 deletions dev/PowerNotifications/PowerNotifications.idl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ namespace Microsoft.Windows.System.Power
static event Windows.Foundation.EventHandler<Object> SystemIdleStatusChanged;

static Windows.Foundation.IAsyncOperation<EffectivePowerMode> EffectivePowerMode{ get; };
static EffectivePowerMode EffectivePowerMode2{ get; };
static event Windows.Foundation.EventHandler<Object> EffectivePowerModeChanged;

static UserPresenceStatus UserPresenceStatus{ get; };
Expand Down