From 87f2cc884a7f7a001f1f5913863712dd71038743 Mon Sep 17 00:00:00 2001 From: pkar Date: Thu, 3 Sep 2020 12:19:32 +0200 Subject: [PATCH] feat: AppModel-Background-struct --- .../Background/BackgroundAccessStatus.cs | 20 +++++++++++++ .../Background/IBackgroundCondition.cs | 12 ++++++++ .../Background/SystemCondition.cs | 17 +++++++++++ .../Background/SystemConditionType.cs | 23 +++++++++++++++ .../Background/SystemTriggerType.cs | 28 +++++++++++++++++++ .../BackgroundAccessStatus.cs | 3 +- .../IBackgroundCondition.cs | 2 +- .../SystemCondition.cs | 6 ++-- .../SystemConditionType.cs | 3 +- .../SystemTriggerType.cs | 3 +- 10 files changed, 110 insertions(+), 7 deletions(-) create mode 100644 src/Uno.UWP/ApplicationModel/Background/BackgroundAccessStatus.cs create mode 100644 src/Uno.UWP/ApplicationModel/Background/IBackgroundCondition.cs create mode 100644 src/Uno.UWP/ApplicationModel/Background/SystemCondition.cs create mode 100644 src/Uno.UWP/ApplicationModel/Background/SystemConditionType.cs create mode 100644 src/Uno.UWP/ApplicationModel/Background/SystemTriggerType.cs diff --git a/src/Uno.UWP/ApplicationModel/Background/BackgroundAccessStatus.cs b/src/Uno.UWP/ApplicationModel/Background/BackgroundAccessStatus.cs new file mode 100644 index 000000000000..98aaea8fe5a5 --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Background/BackgroundAccessStatus.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Windows.ApplicationModel.Background +{ + public enum BackgroundAccessStatus + { + Unspecified, + AllowedWithAlwaysOnRealTimeConnectivity, + AllowedMayUseActiveRealTimeConnectivity, + Denied, + AlwaysAllowed, + AllowedSubjectToSystemPolicy, + DeniedBySystemPolicy, + DeniedByUser, + } +} diff --git a/src/Uno.UWP/ApplicationModel/Background/IBackgroundCondition.cs b/src/Uno.UWP/ApplicationModel/Background/IBackgroundCondition.cs new file mode 100644 index 000000000000..c562a98e50e6 --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Background/IBackgroundCondition.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Windows.ApplicationModel.Background +{ + public partial interface IBackgroundCondition + { + } +} diff --git a/src/Uno.UWP/ApplicationModel/Background/SystemCondition.cs b/src/Uno.UWP/ApplicationModel/Background/SystemCondition.cs new file mode 100644 index 000000000000..291aeaeb15e3 --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Background/SystemCondition.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Windows.ApplicationModel.Background +{ + public partial class SystemCondition : IBackgroundCondition + { + public SystemConditionType ConditionType { get; } + public SystemCondition(SystemConditionType conditionType) + { + ConditionType = conditionType; + } + } +} diff --git a/src/Uno.UWP/ApplicationModel/Background/SystemConditionType.cs b/src/Uno.UWP/ApplicationModel/Background/SystemConditionType.cs new file mode 100644 index 000000000000..1aafffc5abff --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Background/SystemConditionType.cs @@ -0,0 +1,23 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Windows.ApplicationModel.Background +{ + public enum SystemConditionType + { + Invalid, + UserPresent, + UserNotPresent, + InternetAvailable, + InternetNotAvailable, + SessionConnected, + SessionDisconnected, + FreeNetworkAvailable, + BackgroundWorkCostNotHigh, + } + +} diff --git a/src/Uno.UWP/ApplicationModel/Background/SystemTriggerType.cs b/src/Uno.UWP/ApplicationModel/Background/SystemTriggerType.cs new file mode 100644 index 000000000000..249e09359483 --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Background/SystemTriggerType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Windows.ApplicationModel.Background +{ + public enum SystemTriggerType + { + Invalid, + SmsReceived, + UserPresent, + UserAway, + NetworkStateChange, + ControlChannelReset, + InternetAvailable, + SessionConnected, + ServicingComplete, + LockScreenApplicationAdded, + LockScreenApplicationRemoved, + TimeZoneChange, + OnlineIdConnectedStateChange, + BackgroundWorkCostChange, + PowerStateChange, + DefaultSignInAccountChange, + } +} diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/BackgroundAccessStatus.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/BackgroundAccessStatus.cs index 8835a97b1ae3..020960e5c4c6 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/BackgroundAccessStatus.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/BackgroundAccessStatus.cs @@ -2,7 +2,8 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Background { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false + #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ [global::Uno.NotImplemented] #endif diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/IBackgroundCondition.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/IBackgroundCondition.cs index c80cdb5f8648..4b1d4510e10a 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/IBackgroundCondition.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/IBackgroundCondition.cs @@ -2,7 +2,7 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Background { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial interface IBackgroundCondition diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemCondition.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemCondition.cs index 76325f1faf70..cb1f333d2b05 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemCondition.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemCondition.cs @@ -2,12 +2,12 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Background { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial class SystemCondition : global::Windows.ApplicationModel.Background.IBackgroundCondition { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.ApplicationModel.Background.SystemConditionType ConditionType { @@ -17,7 +17,7 @@ public partial class SystemCondition : global::Windows.ApplicationModel.Backgro } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public SystemCondition( global::Windows.ApplicationModel.Background.SystemConditionType conditionType) { diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemConditionType.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemConditionType.cs index 7c97894524ce..f7d06e0ca8c3 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemConditionType.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemConditionType.cs @@ -2,7 +2,8 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Background { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false + #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ [global::Uno.NotImplemented] #endif diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemTriggerType.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemTriggerType.cs index 57e31de71a5b..bded91f53193 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemTriggerType.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Background/SystemTriggerType.cs @@ -2,7 +2,8 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Background { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false + #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ [global::Uno.NotImplemented] #endif