SoraV2Utils/SoraV2Utils_Agent/NotificationSender.cs
2025-01-13 16:27:29 +01:00

29 lines
802 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
namespace SoraV2Utils_Agent
{
public interface IToastNotification
{
void SendToastNotification(string xml, string title);
}
public class NotificationSender : IToastNotification
{
public void SendToastNotification(string xml, string title)
{
XmlDocument tileXml = new XmlDocument();
tileXml.LoadXml(xml);
var toastNotification = new ToastNotification(tileXml);
toastNotification.Priority = ToastNotificationPriority.High;
ToastNotificationManager.CreateToastNotifier(title).Show(toastNotification);
}
}
}