mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-07 14:17:59 +03:00
Refactor
This commit is contained in:
@@ -35,6 +35,7 @@ namespace v2rayN.ViewModels
|
||||
private readonly PaletteHelper _paletteHelper = new();
|
||||
private Dictionary<string, bool> _dicHeaderSort = new();
|
||||
private Action<EViewAction> _updateView;
|
||||
private bool _showInTaskbar;
|
||||
|
||||
#endregion private prop
|
||||
|
||||
@@ -568,7 +569,7 @@ namespace v2rayN.ViewModels
|
||||
|
||||
AutoHideStartup();
|
||||
|
||||
Global.ShowInTaskbar = true;
|
||||
_showInTaskbar = true;
|
||||
}
|
||||
|
||||
private void Init()
|
||||
@@ -635,7 +636,7 @@ namespace v2rayN.ViewModels
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke((Action)(() =>
|
||||
{
|
||||
if (!Global.ShowInTaskbar)
|
||||
if (!_showInTaskbar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1183,7 +1184,7 @@ namespace v2rayN.ViewModels
|
||||
_noticeHandler?.SendMessage(msg, true);
|
||||
Application.Current.Dispatcher.Invoke((Action)(() =>
|
||||
{
|
||||
if (!Global.ShowInTaskbar)
|
||||
if (!_showInTaskbar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1658,7 +1659,7 @@ namespace v2rayN.ViewModels
|
||||
|
||||
public void ShowHideWindow(bool? blShow)
|
||||
{
|
||||
var bl = blShow ?? !Global.ShowInTaskbar;
|
||||
var bl = blShow ?? !_showInTaskbar;
|
||||
if (bl)
|
||||
{
|
||||
//Application.Current.MainWindow.ShowInTaskbar = true;
|
||||
@@ -1677,7 +1678,7 @@ namespace v2rayN.ViewModels
|
||||
//IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle;
|
||||
//Utils.RegWriteValue(Global.MyRegPath, Utils.WindowHwndKey, Convert.ToString((long)windowHandle));
|
||||
}
|
||||
Global.ShowInTaskbar = bl;
|
||||
_showInTaskbar = bl;
|
||||
}
|
||||
|
||||
private void RestoreUI()
|
||||
|
||||
Reference in New Issue
Block a user