v2rayN/v2rayN/v2rayN/Handler/NoticeHandler.cs
Ali Jebali e1cd0bbf63 - Update Project and Libraries to .Net 7
- Update Nuget Packages
- Update Namespaces to C# 10 Style
- Change BinaryFormatter to XmlSerializer
2023-08-28 13:15:36 +03:30

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");
}
}