mirror of
https://github.com/bolucat/Archive.git
synced 2025-09-26 20:21:35 +08:00
41 lines
983 B
C#
41 lines
983 B
C#
using ReactiveUI;
|
|
|
|
namespace ServiceLib.Handler
|
|
{
|
|
public class NoticeHandler
|
|
{
|
|
public void Enqueue(string? content)
|
|
{
|
|
if (content.IsNullOrEmpty())
|
|
{
|
|
return;
|
|
}
|
|
MessageBus.Current.SendMessage(content, Global.CommandSendSnackMsg);
|
|
}
|
|
|
|
public void SendMessage(string? content)
|
|
{
|
|
if (content.IsNullOrEmpty())
|
|
{
|
|
return;
|
|
}
|
|
MessageBus.Current.SendMessage(content, Global.CommandSendMsgView);
|
|
}
|
|
|
|
public void SendMessageEx(string? content )
|
|
{
|
|
if (content.IsNullOrEmpty())
|
|
{
|
|
return;
|
|
}
|
|
content = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss} {content}";
|
|
SendMessage(content);
|
|
}
|
|
|
|
public void SendMessageAndEnqueue(string? msg)
|
|
{
|
|
Enqueue(msg);
|
|
SendMessage(msg);
|
|
}
|
|
}
|
|
} |