Clean code

pull/5550/head
2dust 2024-08-10 19:20:31 +08:00
parent 2504b4737b
commit 3dd75b17cf
5 changed files with 9 additions and 20 deletions

View File

@ -2,18 +2,18 @@
{
public enum EViewAction
{
AdjustMainLvColWidth,
ProfilesFocus,
CloseWindow,
ShowYesNo,
AddBatchRoutingRulesYesNo,
AdjustMainLvColWidth,
ProfilesFocus,
ShareSub,
ShareServer,
SubEditWindow,
SubShare,
RoutingRuleSettingWindow,
RoutingRuleDetailsWindow,
AddServerWindow,
AddServer2Window,
ShareServer,
DNSSettingWindow,
RoutingSettingWindow,
OptionSettingWindow,

View File

@ -439,10 +439,6 @@ namespace v2rayN.ViewModels
{
Reload();
}
if (_config.uiItem.enableAutoAdjustMainLvColWidth)
{
_updateView?.Invoke(EViewAction.AdjustMainLvColWidth, null);
}
}
}

View File

@ -56,7 +56,7 @@ namespace v2rayN.ViewModels
}, canEditRemove);
SubShareCmd = ReactiveCommand.Create(() =>
{
_updateView?.Invoke(EViewAction.SubShare, SelectedSource?.url);
_updateView?.Invoke(EViewAction.ShareSub, SelectedSource?.url);
}, canEditRemove);
}

View File

@ -100,14 +100,7 @@ namespace v2rayN.Views
private bool UpdateViewHandler(EViewAction action, object? obj)
{
if (action == EViewAction.AdjustMainLvColWidth)
{
Application.Current.Dispatcher.Invoke(() =>
{
AutofitColumnWidth();
});
}
else if (action == EViewAction.ProfilesFocus)
if (action == EViewAction.ProfilesFocus)
{
lstProfiles.Focus();
}

View File

@ -54,15 +54,15 @@ namespace v2rayN.Views
if (obj is null) return false;
return (new SubEditWindow((SubItem)obj)).ShowDialog() ?? false;
}
else if (action == EViewAction.SubShare)
else if (action == EViewAction.ShareSub)
{
if (obj is null) return false;
SubShare((string)obj);
ShareSub((string)obj);
}
return true;
}
private async void SubShare(string url)
private async void ShareSub(string url)
{
if (Utils.IsNullOrEmpty(url))
{