mirror of https://github.com/2dust/v2rayN
Clean code
parent
2504b4737b
commit
3dd75b17cf
|
@ -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,
|
||||
|
|
|
@ -439,10 +439,6 @@ namespace v2rayN.ViewModels
|
|||
{
|
||||
Reload();
|
||||
}
|
||||
if (_config.uiItem.enableAutoAdjustMainLvColWidth)
|
||||
{
|
||||
_updateView?.Invoke(EViewAction.AdjustMainLvColWidth, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace v2rayN.ViewModels
|
|||
}, canEditRemove);
|
||||
SubShareCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
_updateView?.Invoke(EViewAction.SubShare, SelectedSource?.url);
|
||||
_updateView?.Invoke(EViewAction.ShareSub, SelectedSource?.url);
|
||||
}, canEditRemove);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue