Skip to content

Commit

Permalink
feat: TimeTrigger (struct)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkar70 committed Sep 8, 2020
1 parent 5aef946 commit f605056
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/Uno.UWP/ApplicationModel/Background/IBackgroundTrigger.cs
Original file line number Diff line number Diff line change
@@ -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 IBackgroundTrigger
{
}
}
24 changes: 24 additions & 0 deletions src/Uno.UWP/ApplicationModel/Background/TimeTrigger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Windows.ApplicationModel.Background
{
public partial class TimeTrigger : IBackgroundTrigger
{
public uint FreshnessTime { get; }
public bool OneShot { get; }

public TimeTrigger(uint freshnessTime, bool oneShot)
{
if (freshnessTime < 15)
{
throw new ArgumentOutOfRangeException("TimeTrigger.FreshnessTime should be > 15 minutes");
}
FreshnessTime = freshnessTime;
OneShot = oneShot;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 IBackgroundTrigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 TimeTrigger : global::Windows.ApplicationModel.Background.IBackgroundTrigger
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public uint FreshnessTime
{
Expand All @@ -17,7 +17,7 @@ public uint FreshnessTime
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public bool OneShot
{
Expand All @@ -27,7 +27,7 @@ public bool OneShot
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public TimeTrigger( uint freshnessTime, bool oneShot)
{
Expand Down

0 comments on commit f605056

Please sign in to comment.