Skip to content

Commit

Permalink
feat: ToastNotification and NotificationMirroring definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
pkar70 committed Sep 19, 2020
1 parent 4511160 commit ab317b0
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Notifications
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
#if false
[global::Uno.NotImplemented]
#endif
public enum NotificationMirroring
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
Allowed,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
Disabled,
#endif
}
Expand Down
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.UI.Notifications
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented]
#endif
public partial class ToastNotification
Expand All @@ -21,7 +21,7 @@ public partial class ToastNotification
}
}
#endif
#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.Data.Xml.Dom.XmlDocument Content
{
Expand All @@ -31,7 +31,7 @@ public partial class ToastNotification
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public string Tag
{
Expand Down Expand Up @@ -143,7 +143,7 @@ public bool ExpiresOnReboot
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public ToastNotification( global::Windows.Data.Xml.Dom.XmlDocument content)
{
Expand Down
9 changes: 9 additions & 0 deletions src/Uno.UWP/UI/Notifications/NotificationMirroring.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

namespace Windows.UI.Notifications
{
public enum NotificationMirroring
{
Allowed,
Disabled,
}
}
41 changes: 41 additions & 0 deletions src/Uno.UWP/UI/Notifications/ToastNotification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Uno.Logging;
using Microsoft.Extensions.Logging;
using Uno.Extensions;

namespace Windows.UI.Notifications
{
public partial class ToastNotification
{

private string _Tag;
public string Tag {
get
{
return this._Tag;
}
set
{
this._Tag = value;
if(this._Tag.Length > 64)
{
// UWP limit: 16 chars, since Creators Update (15063) - 64 characters
this.Log().Warn("Windows.UI.Notifications.ToastNotification.Tag is set to string longer than UWP limit");
}
}
}

public Windows.Data.Xml.Dom.XmlDocument Content { get; internal set; }

public ToastNotification(Windows.Data.Xml.Dom.XmlDocument content)
{
Content = content;
}

}
}

0 comments on commit ab317b0

Please sign in to comment.