2dust 3 months ago
parent
commit
c83dce3cc0
  1. 4
      v2rayN/ServiceLib/Handler/NoticeHandler.cs
  2. 2
      v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs
  3. 8
      v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs
  4. 2
      v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs

4
v2rayN/ServiceLib/Handler/NoticeHandler.cs

@ -22,13 +22,13 @@ namespace ServiceLib.Handler
MessageBus.Current.SendMessage(content, Global.CommandSendMsgView);
}
public void SendMessage(string? content, bool time)
public void SendMessageEx(string? content )
{
if (content.IsNullOrEmpty())
{
return;
}
content = $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {content}";
content = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss} {content}";
SendMessage(content);
}

2
v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs

@ -135,7 +135,7 @@ namespace ServiceLib.ViewModels
private void UpdateHandler(bool notify, string msg)
{
_noticeHandler?.SendMessage(msg, true);
_noticeHandler?.SendMessageEx(msg);
}
public void ProxiesReload()

8
v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs

@ -391,7 +391,7 @@ namespace ServiceLib.ViewModels
private void UpdateTaskHandler(bool success, string msg)
{
_noticeHandler?.SendMessage(msg);
_noticeHandler?.SendMessageEx(msg);
if (success)
{
var indexIdOld = _config.indexId;
@ -631,7 +631,7 @@ namespace ServiceLib.ViewModels
}
(new UpdateHandler()).RunAvailabilityCheck(async (bool success, string msg) =>
{
_noticeHandler?.SendMessage(msg, true);
_noticeHandler?.SendMessageEx(msg);
if (!_config.uiItem.showInTaskbar)
{
@ -881,7 +881,7 @@ namespace ServiceLib.ViewModels
private async Task ChangeSystemProxyStatusAsync(ESysProxyType type, bool blChange)
{
await _updateView?.Invoke(EViewAction.UpdateSysProxy, _config.tunModeItem.enableTun ? true : false);
_noticeHandler?.SendMessage($"{ResUI.TipChangeSystemProxy} - {_config.systemProxyItem.sysProxyType.ToString()}", true);
_noticeHandler?.SendMessageEx($"{ResUI.TipChangeSystemProxy} - {_config.systemProxyItem.sysProxyType.ToString()}");
BlSystemProxyClear = (type == ESysProxyType.ForcedClear);
BlSystemProxySet = (type == ESysProxyType.ForcedChange);
@ -941,7 +941,7 @@ namespace ServiceLib.ViewModels
if (ConfigHandler.SetDefaultRouting(_config, item) == 0)
{
_noticeHandler?.SendMessage(ResUI.TipChangeRouting, true);
_noticeHandler?.SendMessageEx(ResUI.TipChangeRouting);
Reload();
await _updateView?.Invoke(EViewAction.DispatcherRefreshIcon, null);
}

2
v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs

@ -258,7 +258,7 @@ namespace ServiceLib.ViewModels
{
if (Utils.IsNullOrEmpty(result.IndexId))
{
_noticeHandler?.SendMessage(result.Delay, true);
_noticeHandler?.SendMessageEx(result.Delay);
_noticeHandler?.Enqueue(result.Delay);
return;
}

Loading…
Cancel
Save