mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-29 14:26:20 +00:00

- Update Nuget Packages - Update Namespaces to C# 10 Style - Change BinaryFormatter to XmlSerializer
32 lines
No EOL
837 B
C#
32 lines
No EOL
837 B
C#
using MaterialDesignThemes.Wpf;
|
|
using ReactiveUI;
|
|
|
|
namespace v2rayN.Handler;
|
|
|
|
public class NoticeHandler
|
|
{
|
|
private readonly ISnackbarMessageQueue _snackbarMessageQueue;
|
|
|
|
public NoticeHandler(ISnackbarMessageQueue snackbarMessageQueue)
|
|
{
|
|
_snackbarMessageQueue = snackbarMessageQueue ?? throw new ArgumentNullException(nameof(snackbarMessageQueue));
|
|
|
|
//_snackbarMessageQueue = snackbarMessageQueue;
|
|
}
|
|
|
|
public void Enqueue(object content)
|
|
{
|
|
_snackbarMessageQueue?.Enqueue(content);
|
|
}
|
|
|
|
public void SendMessage(string msg)
|
|
{
|
|
MessageBus.Current.SendMessage(msg, "MsgView");
|
|
}
|
|
|
|
public void SendMessage(string msg, bool time)
|
|
{
|
|
msg = $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {msg}";
|
|
MessageBus.Current.SendMessage(msg, "MsgView");
|
|
}
|
|
} |