XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

HaloPixelToolBox

【WinUI3】基于USB HID通讯的花再音响工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
using HaloPixelToolBox.Core.Utilities;

namespace HaloPixelToolBox.Core.Models.Notifications;

public sealed record MessageNotification(MessageNotificationSource Source, string Sender = "", string Content = "")
{
    public bool HasDetails => Sender.Length > 0 || Content.Length > 0;

    public string DisplayText
    {
        get
        {
            var app = MessageNotificationClassifier.GetDisplayName(Source);
            if (Sender.Length > 0)
                return $"{app} {Sender}:{(Content.Length > 0 ? Content : "有新消息")}";
            return $"{app}:{(Content.Length > 0 ? Content : "有新消息")}";
        }
    }
}