mirror of https://github.com/2dust/v2rayN
Clean code
parent
2504b4737b
commit
3dd75b17cf
|
@ -2,18 +2,18 @@
|
||||||
{
|
{
|
||||||
public enum EViewAction
|
public enum EViewAction
|
||||||
{
|
{
|
||||||
AdjustMainLvColWidth,
|
|
||||||
ProfilesFocus,
|
|
||||||
CloseWindow,
|
CloseWindow,
|
||||||
ShowYesNo,
|
ShowYesNo,
|
||||||
AddBatchRoutingRulesYesNo,
|
AddBatchRoutingRulesYesNo,
|
||||||
|
AdjustMainLvColWidth,
|
||||||
|
ProfilesFocus,
|
||||||
|
ShareSub,
|
||||||
|
ShareServer,
|
||||||
SubEditWindow,
|
SubEditWindow,
|
||||||
SubShare,
|
|
||||||
RoutingRuleSettingWindow,
|
RoutingRuleSettingWindow,
|
||||||
RoutingRuleDetailsWindow,
|
RoutingRuleDetailsWindow,
|
||||||
AddServerWindow,
|
AddServerWindow,
|
||||||
AddServer2Window,
|
AddServer2Window,
|
||||||
ShareServer,
|
|
||||||
DNSSettingWindow,
|
DNSSettingWindow,
|
||||||
RoutingSettingWindow,
|
RoutingSettingWindow,
|
||||||
OptionSettingWindow,
|
OptionSettingWindow,
|
||||||
|
|
|
@ -439,10 +439,6 @@ namespace v2rayN.ViewModels
|
||||||
{
|
{
|
||||||
Reload();
|
Reload();
|
||||||
}
|
}
|
||||||
if (_config.uiItem.enableAutoAdjustMainLvColWidth)
|
|
||||||
{
|
|
||||||
_updateView?.Invoke(EViewAction.AdjustMainLvColWidth, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace v2rayN.ViewModels
|
||||||
}, canEditRemove);
|
}, canEditRemove);
|
||||||
SubShareCmd = ReactiveCommand.Create(() =>
|
SubShareCmd = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
_updateView?.Invoke(EViewAction.SubShare, SelectedSource?.url);
|
_updateView?.Invoke(EViewAction.ShareSub, SelectedSource?.url);
|
||||||
}, canEditRemove);
|
}, canEditRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,14 +100,7 @@ namespace v2rayN.Views
|
||||||
|
|
||||||
private bool UpdateViewHandler(EViewAction action, object? obj)
|
private bool UpdateViewHandler(EViewAction action, object? obj)
|
||||||
{
|
{
|
||||||
if (action == EViewAction.AdjustMainLvColWidth)
|
if (action == EViewAction.ProfilesFocus)
|
||||||
{
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
AutofitColumnWidth();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if (action == EViewAction.ProfilesFocus)
|
|
||||||
{
|
{
|
||||||
lstProfiles.Focus();
|
lstProfiles.Focus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,15 +54,15 @@ namespace v2rayN.Views
|
||||||
if (obj is null) return false;
|
if (obj is null) return false;
|
||||||
return (new SubEditWindow((SubItem)obj)).ShowDialog() ?? false;
|
return (new SubEditWindow((SubItem)obj)).ShowDialog() ?? false;
|
||||||
}
|
}
|
||||||
else if (action == EViewAction.SubShare)
|
else if (action == EViewAction.ShareSub)
|
||||||
{
|
{
|
||||||
if (obj is null) return false;
|
if (obj is null) return false;
|
||||||
SubShare((string)obj);
|
ShareSub((string)obj);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void SubShare(string url)
|
private async void ShareSub(string url)
|
||||||
{
|
{
|
||||||
if (Utils.IsNullOrEmpty(url))
|
if (Utils.IsNullOrEmpty(url))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue