From 2944f74e69c7e6391e1d11b0d46d61aec7be370f Mon Sep 17 00:00:00 2001 From: godlytalias Date: Fri, 20 Dec 2024 21:10:18 +0600 Subject: [PATCH] Added TaskGroup property support to BackgroundTaskBuilder API Signed-off-by: godlytalias --- .../BackgroundTaskBuilder/BackgroundTaskBuilder.cpp | 10 ++++++++++ .../BackgroundTaskBuilder/BackgroundTaskBuilder.h | 3 +++ .../BackgroundTaskBuilder/BackgroundTaskBuilder.idl | 1 + specs/BackgroundTask/BackgroundTaskBuilder.md | 1 + 4 files changed, 15 insertions(+) diff --git a/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.cpp b/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.cpp index cbcebc8f91..b606a7b7fb 100644 --- a/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.cpp +++ b/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.cpp @@ -24,6 +24,16 @@ namespace winrt::Microsoft::Windows::ApplicationModel::Background::implementatio m_name = name; } + void BackgroundTaskBuilder::TaskGroup(winrt::BackgroundTaskRegistrationGroup TaskGroup) + { + m_builder.TaskGroup(TaskGroup); + } + + winrt::BackgroundTaskRegistrationGroup BackgroundTaskBuilder::TaskGroup() + { + return m_builder.TaskGroup(); + } + void BackgroundTaskBuilder::SetTrigger(winrt::IBackgroundTrigger trigger) { m_builder.SetTrigger(trigger); diff --git a/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.h b/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.h index ca0e55e19f..090ebdb6cc 100644 --- a/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.h +++ b/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.h @@ -29,6 +29,9 @@ namespace winrt::Microsoft::Windows::ApplicationModel::Background::implementatio void Name(winrt::hstring Name); winrt::hstring Name() { return m_name; } + void TaskGroup(winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup TaskGroup); + winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup TaskGroup(); + winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistration Register(); winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistration Register(winrt::hstring taskName); diff --git a/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.idl b/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.idl index d1b34aa0d6..6d8449c01a 100644 --- a/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.idl +++ b/dev/BackgroundTask/BackgroundTaskBuilder/BackgroundTaskBuilder.idl @@ -24,6 +24,7 @@ namespace Microsoft.Windows.ApplicationModel.Background ); String Name{ set; get; }; + Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup TaskGroup{ set; get; }; [return_name("task")] Windows.ApplicationModel.Background.BackgroundTaskRegistration Register(); diff --git a/specs/BackgroundTask/BackgroundTaskBuilder.md b/specs/BackgroundTask/BackgroundTaskBuilder.md index 9dfd9ca329..e28cffa7b3 100644 --- a/specs/BackgroundTask/BackgroundTaskBuilder.md +++ b/specs/BackgroundTask/BackgroundTaskBuilder.md @@ -105,6 +105,7 @@ namespace Microsoft.Windows.ApplicationModel.Background ); String Name{ set; get; }; + Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup TaskGroup { set; get; }; Windows.ApplicationModel.Background.BackgroundTaskRegistration Register( );