mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-02 02:25:01 +03:00
ReactiveUI 24 (#9678)
* ReactiveUI.SourceGenerators * Primitives * Try fix
This commit is contained in:
@@ -1,45 +1,45 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class AddGroupServerViewModel : MyReactiveObject, ICloseable
|
||||
public partial class AddGroupServerViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
[Reactive]
|
||||
public ProfileItem SelectedSource { get; set; }
|
||||
public partial ProfileItem SelectedSource { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public ProfileItem SelectedChild { get; set; }
|
||||
public partial ProfileItem SelectedChild { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public IList<ProfileItem> SelectedChildren { get; set; }
|
||||
public partial IList<ProfileItem> SelectedChildren { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? CoreType { get; set; }
|
||||
public partial string? CoreType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? PolicyGroupType { get; set; }
|
||||
public partial string? PolicyGroupType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public SubItem? SelectedSubItem { get; set; }
|
||||
public partial SubItem? SelectedSubItem { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? Filter { get; set; }
|
||||
public partial string? Filter { get; set; }
|
||||
|
||||
public IObservableCollection<SubItem> SubItems { get; } = new ObservableCollectionExtended<SubItem>();
|
||||
public BulkObservableCollection<SubItem> SubItems { get; } = [];
|
||||
|
||||
public IObservableCollection<ProfileItem> ChildItemsObs { get; } = new ObservableCollectionExtended<ProfileItem>();
|
||||
public BulkObservableCollection<ProfileItem> ChildItemsObs { get; } = [];
|
||||
|
||||
public IObservableCollection<ProfileItem> AllProfilePreviewItemsObs { get; } = new ObservableCollectionExtended<ProfileItem>();
|
||||
public BulkObservableCollection<ProfileItem> AllProfilePreviewItemsObs { get; } = [];
|
||||
|
||||
public ReactiveCommand<Unit, Unit> AddCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RemoveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RemoveCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> MoveTopCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveUpCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveDownCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveBottomCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveTopCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveUpCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveDownCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveBottomCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public AddGroupServerViewModel(ProfileItem profileItem)
|
||||
{
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class AddServer2ViewModel : MyReactiveObject, ICloseable
|
||||
public partial class AddServer2ViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
public Interaction<Unit, string?> BrowseConfigFileInteraction { get; } = new();
|
||||
public Interaction<RxVoid, string?> BrowseConfigFileInteraction { get; } = new();
|
||||
|
||||
[Reactive]
|
||||
public ProfileItem SelectedSource { get; set; }
|
||||
public partial ProfileItem SelectedSource { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? CoreType { get; set; }
|
||||
public partial string? CoreType { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> BrowseServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> BrowseServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> EditServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveServerCmd { get; }
|
||||
public bool IsModified { get; set; }
|
||||
|
||||
public AddServer2ViewModel(ProfileItem profileItem)
|
||||
@@ -23,7 +23,7 @@ public class AddServer2ViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
BrowseServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
var fileName = await BrowseConfigFileInteraction.Handle(Unit.Default);
|
||||
var fileName = await BrowseConfigFileInteraction.Handle(RxVoid.Default);
|
||||
if (fileName.IsNullOrEmpty())
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -1,131 +1,131 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
public partial class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
[Reactive]
|
||||
public ProfileItem SelectedSource { get; set; }
|
||||
public partial ProfileItem SelectedSource { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? CoreType { get; set; }
|
||||
public partial string? CoreType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AllowInsecure { get; set; }
|
||||
public partial bool AllowInsecure { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool MuxEnabled { get; set; }
|
||||
public partial bool MuxEnabled { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Cert { get; set; }
|
||||
public partial string Cert { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string CertTip { get; set; }
|
||||
public partial string CertTip { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string CertSha { get; set; }
|
||||
public partial string CertSha { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string SalamanderPass { get; set; }
|
||||
public partial string SalamanderPass { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int AlterId { get; set; }
|
||||
public partial int AlterId { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Ports { get; set; }
|
||||
public partial string Ports { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int? UpMbps { get; set; }
|
||||
public partial int? UpMbps { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int? DownMbps { get; set; }
|
||||
public partial int? DownMbps { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string HopInterval { get; set; }
|
||||
public partial string HopInterval { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Flow { get; set; }
|
||||
public partial string Flow { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string VmessSecurity { get; set; }
|
||||
public partial string VmessSecurity { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string VlessEncryption { get; set; }
|
||||
public partial string VlessEncryption { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string SsMethod { get; set; }
|
||||
public partial string SsMethod { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string WgPublicKey { get; set; }
|
||||
public partial string WgPublicKey { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string WgPresharedKey { get; set; }
|
||||
public partial string WgPresharedKey { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string WgInterfaceAddress { get; set; }
|
||||
public partial string WgInterfaceAddress { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string WgReserved { get; set; }
|
||||
public partial string WgReserved { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int WgMtu { get; set; }
|
||||
public partial int WgMtu { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool Uot { get; set; }
|
||||
public partial bool Uot { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string CongestionControl { get; set; }
|
||||
public partial string CongestionControl { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int? InsecureConcurrency { get; set; }
|
||||
public partial int? InsecureConcurrency { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool NaiveQuic { get; set; }
|
||||
public partial bool NaiveQuic { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string HttpHeadersJson { get; set; }
|
||||
public partial string HttpHeadersJson { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Hy2RealmUrl { get; set; }
|
||||
public partial string Hy2RealmUrl { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int GeckoMinPacketSize { get; set; }
|
||||
public partial int GeckoMinPacketSize { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int GeckoMaxPacketSize { get; set; }
|
||||
public partial int GeckoMaxPacketSize { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string RawHeaderType { get; set; }
|
||||
public partial string RawHeaderType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Host { get; set; }
|
||||
public partial string Host { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Path { get; set; }
|
||||
public partial string Path { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string XhttpMode { get; set; }
|
||||
public partial string XhttpMode { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string XhttpExtra { get; set; }
|
||||
public partial string XhttpExtra { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string GrpcAuthority { get; set; }
|
||||
public partial string GrpcAuthority { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string GrpcServiceName { get; set; }
|
||||
public partial string GrpcServiceName { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string GrpcMode { get; set; }
|
||||
public partial string GrpcMode { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string KcpHeaderType { get; set; }
|
||||
public partial string KcpHeaderType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string KcpSeed { get; set; }
|
||||
public partial string KcpSeed { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int? KcpMtu { get; set; }
|
||||
public partial int? KcpMtu { get; set; }
|
||||
|
||||
public string TransportHeaderType
|
||||
{
|
||||
@@ -239,9 +239,9 @@ public class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
}
|
||||
}
|
||||
|
||||
public ReactiveCommand<Unit, Unit> FetchCertCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> FetchCertChainCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> FetchCertCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> FetchCertChainCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public AddServerViewModel(ProfileItem profileItem)
|
||||
{
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class BackupAndRestoreViewModel : MyReactiveObject
|
||||
public partial class BackupAndRestoreViewModel : MyReactiveObject
|
||||
{
|
||||
private readonly string _guiConfigs = "guiConfigs";
|
||||
private static string BackupFileName => $"backup_{DateTime.Now:yyyyMMddHHmmss}.zip";
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RemoteBackupCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RemoteRestoreCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> WebDavCheckCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RemoteBackupCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RemoteRestoreCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> WebDavCheckCmd { get; }
|
||||
|
||||
[Reactive]
|
||||
public WebDavItem SelectedSource { get; set; }
|
||||
public partial WebDavItem SelectedSource { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string OperationMsg { get; set; } = string.Empty;
|
||||
public partial string OperationMsg { get; set; } = string.Empty;
|
||||
|
||||
public BackupAndRestoreViewModel()
|
||||
{
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class CheckUpdateViewModel : MyReactiveObject
|
||||
public partial class CheckUpdateViewModel : MyReactiveObject
|
||||
{
|
||||
private const string _geo = "GeoFiles";
|
||||
private readonly ECoreType _v2rayN = ECoreType.v2rayN;
|
||||
private List<CheckUpdateModel> _lstUpdated = [];
|
||||
private static readonly string _tag = "CheckUpdateViewModel";
|
||||
|
||||
public EventChannel<Unit> ReloadRequested { get; } = new();
|
||||
public EventChannel<RxVoid> ReloadRequested { get; } = new();
|
||||
|
||||
public IObservableCollection<CheckUpdateModel> CheckUpdateModels { get; } = new ObservableCollectionExtended<CheckUpdateModel>();
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> CheckOnlyCmd { get; }
|
||||
[Reactive] public bool EnableCheckPreReleaseUpdate { get; set; }
|
||||
public BulkObservableCollection<CheckUpdateModel> CheckUpdateModels { get; } = [];
|
||||
public ReactiveCommand<RxVoid, RxVoid> CheckUpdateCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> CheckOnlyCmd { get; }
|
||||
[Reactive] public partial bool EnableCheckPreReleaseUpdate { get; set; }
|
||||
|
||||
public CheckUpdateViewModel()
|
||||
{
|
||||
@@ -288,10 +288,9 @@ public class CheckUpdateViewModel : MyReactiveObject
|
||||
|
||||
private async Task UpdateFinishedSub(bool blReload)
|
||||
{
|
||||
RxSchedulers.MainThreadScheduler.Schedule(blReload, (scheduler, blReload) =>
|
||||
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
_ = UpdateFinishedResult(blReload);
|
||||
return Disposable.Empty;
|
||||
});
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
@@ -404,10 +403,9 @@ public class CheckUpdateViewModel : MyReactiveObject
|
||||
Remarks = msg,
|
||||
};
|
||||
|
||||
RxSchedulers.MainThreadScheduler.Schedule(item, (scheduler, model) =>
|
||||
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
_ = UpdateViewResult(model);
|
||||
return Disposable.Empty;
|
||||
_ = UpdateViewResult(item);
|
||||
});
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class ClashConnectionsViewModel : MyReactiveObject
|
||||
public partial class ClashConnectionsViewModel : MyReactiveObject
|
||||
{
|
||||
public IObservableCollection<ClashConnectionModel> ConnectionItems { get; } = new ObservableCollectionExtended<ClashConnectionModel>();
|
||||
public BulkObservableCollection<ClashConnectionModel> ConnectionItems { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public ClashConnectionModel SelectedSource { get; set; }
|
||||
public partial ClashConnectionModel SelectedSource { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> ConnectionCloseCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ConnectionCloseAllCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ConnectionCloseCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ConnectionCloseAllCmd { get; }
|
||||
|
||||
[Reactive]
|
||||
public string HostFilter { get; set; }
|
||||
public partial string HostFilter { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AutoRefresh { get; set; }
|
||||
public partial bool AutoRefresh { get; set; }
|
||||
|
||||
public ClashConnectionsViewModel()
|
||||
{
|
||||
@@ -55,10 +55,9 @@ public class ClashConnectionsViewModel : MyReactiveObject
|
||||
return;
|
||||
}
|
||||
|
||||
RxSchedulers.MainThreadScheduler.Schedule(ret?.connections, (scheduler, model) =>
|
||||
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
_ = RefreshConnections(model);
|
||||
return Disposable.Empty;
|
||||
_ = RefreshConnections(ret?.connections);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
using System.Reactive.Concurrency;
|
||||
using static ServiceLib.Models.Dto.ClashProviders;
|
||||
using static ServiceLib.Models.Dto.ClashProxies;
|
||||
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class ClashProxiesViewModel : MyReactiveObject
|
||||
public partial class ClashProxiesViewModel : MyReactiveObject
|
||||
{
|
||||
private Dictionary<string, ProxiesItem>? _proxies;
|
||||
private Dictionary<string, ProvidersItem>? _providers;
|
||||
private readonly int _delayTimeout = 99999999;
|
||||
|
||||
public IObservableCollection<ClashProxyModel> ProxyGroups { get; } = new ObservableCollectionExtended<ClashProxyModel>();
|
||||
public IObservableCollection<ClashProxyModel> ProxyDetails { get; } = new ObservableCollectionExtended<ClashProxyModel>();
|
||||
public BulkObservableCollection<ClashProxyModel> ProxyGroups { get; } = [];
|
||||
public BulkObservableCollection<ClashProxyModel> ProxyDetails { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public ClashProxyModel SelectedGroup { get; set; }
|
||||
public partial ClashProxyModel SelectedGroup { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public ClashProxyModel SelectedDetail { get; set; }
|
||||
public partial ClashProxyModel SelectedDetail { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> ProxiesReloadCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ProxiesDelayTestCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ProxiesDelayTestPartCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ProxiesSelectActivityCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ProxiesReloadCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ProxiesDelayTestCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ProxiesDelayTestPartCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ProxiesSelectActivityCmd { get; }
|
||||
|
||||
[Reactive]
|
||||
public int RuleModeSelected { get; set; }
|
||||
public partial int RuleModeSelected { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int SortingSelected { get; set; }
|
||||
public partial int SortingSelected { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AutoRefresh { get; set; }
|
||||
public partial bool AutoRefresh { get; set; }
|
||||
|
||||
public ClashProxiesViewModel()
|
||||
{
|
||||
@@ -379,10 +378,9 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||
}
|
||||
|
||||
var model = new SpeedTestResult() { IndexId = item.Name, Delay = result };
|
||||
RxSchedulers.MainThreadScheduler.Schedule(model, (scheduler, model) =>
|
||||
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
_ = ProxiesDelayTestResult(model);
|
||||
return Disposable.Empty;
|
||||
});
|
||||
await Task.CompletedTask;
|
||||
});
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class DNSSettingViewModel : MyReactiveObject, ICloseable
|
||||
public partial class DNSSettingViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
[Reactive] public bool UseSystemHosts { get; set; }
|
||||
[Reactive] public bool AddCommonHosts { get; set; }
|
||||
[Reactive] public bool FakeIP { get; set; }
|
||||
[Reactive] public string FakeIPRange { get; set; }
|
||||
[Reactive] public bool BlockBindingQuery { get; set; }
|
||||
[Reactive] public string DirectDNS { get; set; }
|
||||
[Reactive] public string RemoteDNS { get; set; }
|
||||
[Reactive] public string BootstrapDNS { get; set; }
|
||||
[Reactive] public string Strategy4Freedom { get; set; }
|
||||
[Reactive] public string Strategy4Proxy { get; set; }
|
||||
[Reactive] public string Strategy4ProxyDial { get; set; }
|
||||
[Reactive] public string Hosts { get; set; }
|
||||
[Reactive] public string DirectExpectedIPs { get; set; }
|
||||
[Reactive] public bool ParallelQuery { get; set; }
|
||||
[Reactive] public bool ServeStale { get; set; }
|
||||
[Reactive] public bool EnableHappyEyeballs { get; set; }
|
||||
[Reactive] public partial bool UseSystemHosts { get; set; }
|
||||
[Reactive] public partial bool AddCommonHosts { get; set; }
|
||||
[Reactive] public partial bool FakeIP { get; set; }
|
||||
[Reactive] public partial string FakeIPRange { get; set; }
|
||||
[Reactive] public partial bool BlockBindingQuery { get; set; }
|
||||
[Reactive] public partial string DirectDNS { get; set; }
|
||||
[Reactive] public partial string RemoteDNS { get; set; }
|
||||
[Reactive] public partial string BootstrapDNS { get; set; }
|
||||
[Reactive] public partial string Strategy4Freedom { get; set; }
|
||||
[Reactive] public partial string Strategy4Proxy { get; set; }
|
||||
[Reactive] public partial string Strategy4ProxyDial { get; set; }
|
||||
[Reactive] public partial string Hosts { get; set; }
|
||||
[Reactive] public partial string DirectExpectedIPs { get; set; }
|
||||
[Reactive] public partial bool ParallelQuery { get; set; }
|
||||
[Reactive] public partial bool ServeStale { get; set; }
|
||||
[Reactive] public partial bool EnableHappyEyeballs { get; set; }
|
||||
|
||||
[Reactive] public bool UseSystemHostsCompatible { get; set; }
|
||||
[Reactive] public string DomainStrategy4FreedomCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public string DomainDNSAddressCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public string NormalDNSCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public string TunDNSCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial bool UseSystemHostsCompatible { get; set; }
|
||||
[Reactive] public partial string DomainStrategy4FreedomCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial string DomainDNSAddressCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial string NormalDNSCompatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial string TunDNSCompatible { get; set; } = string.Empty;
|
||||
|
||||
[Reactive] public string DomainStrategy4Freedom2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public string DomainDNSAddress2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public string NormalDNS2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public string TunDNS2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public bool RayCustomDNSEnableCompatible { get; set; }
|
||||
[Reactive] public bool SBCustomDNSEnableCompatible { get; set; }
|
||||
[Reactive] public partial string DomainStrategy4Freedom2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial string DomainDNSAddress2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial string NormalDNS2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial string TunDNS2Compatible { get; set; } = string.Empty;
|
||||
[Reactive] public partial bool RayCustomDNSEnableCompatible { get; set; }
|
||||
[Reactive] public partial bool SBCustomDNSEnableCompatible { get; set; }
|
||||
|
||||
[ObservableAsProperty] public bool IsSimpleDNSEnabled { get; }
|
||||
public bool IsSimpleDNSEnabled => !(RayCustomDNSEnableCompatible && SBCustomDNSEnableCompatible);
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportDefConfig4V2rayCompatibleCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportDefConfig4SingboxCompatibleCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ImportDefConfig4V2rayCompatibleCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ImportDefConfig4SingboxCompatibleCmd { get; }
|
||||
|
||||
public DNSSettingViewModel()
|
||||
{
|
||||
@@ -60,8 +60,7 @@ public class DNSSettingViewModel : MyReactiveObject, ICloseable
|
||||
});
|
||||
|
||||
this.WhenAnyValue(x => x.RayCustomDNSEnableCompatible, x => x.SBCustomDNSEnableCompatible)
|
||||
.Select(x => x is not { Item1: true, Item2: true })
|
||||
.ToPropertyEx(this, x => x.IsSimpleDNSEnabled);
|
||||
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsSimpleDNSEnabled)));
|
||||
|
||||
_ = Init();
|
||||
}
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class FullConfigTemplateViewModel : MyReactiveObject, ICloseable
|
||||
public partial class FullConfigTemplateViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
#region Reactive
|
||||
|
||||
[Reactive]
|
||||
public bool EnableFullConfigTemplate4Ray { get; set; }
|
||||
public partial bool EnableFullConfigTemplate4Ray { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool EnableFullConfigTemplate4Singbox { get; set; }
|
||||
public partial bool EnableFullConfigTemplate4Singbox { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string FullConfigTemplate4Ray { get; set; } = string.Empty;
|
||||
public partial string FullConfigTemplate4Ray { get; set; } = string.Empty;
|
||||
|
||||
[Reactive]
|
||||
public string FullTunConfigTemplate4Ray { get; set; } = string.Empty;
|
||||
public partial string FullTunConfigTemplate4Ray { get; set; } = string.Empty;
|
||||
|
||||
[Reactive]
|
||||
public string FullConfigTemplate4Singbox { get; set; } = string.Empty;
|
||||
public partial string FullConfigTemplate4Singbox { get; set; } = string.Empty;
|
||||
|
||||
[Reactive]
|
||||
public string FullTunConfigTemplate4Singbox { get; set; } = string.Empty;
|
||||
public partial string FullTunConfigTemplate4Singbox { get; set; } = string.Empty;
|
||||
|
||||
[Reactive]
|
||||
public bool AddProxyOnly4Ray { get; set; }
|
||||
public partial bool AddProxyOnly4Ray { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AddProxyOnly4Singbox { get; set; }
|
||||
public partial bool AddProxyOnly4Singbox { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string ProxyDetour4Ray { get; set; } = string.Empty;
|
||||
public partial string ProxyDetour4Ray { get; set; } = string.Empty;
|
||||
|
||||
[Reactive]
|
||||
public string ProxyDetour4Singbox { get; set; } = string.Empty;
|
||||
public partial string ProxyDetour4Singbox { get; set; } = string.Empty;
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
#endregion Reactive
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ public class GlobalHotkeySettingViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
private readonly List<KeyEventItem> _globalHotkeys;
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public GlobalHotkeySettingViewModel()
|
||||
{
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
using System.Reactive.Concurrency;
|
||||
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class MainWindowViewModel : MyReactiveObject
|
||||
public partial class MainWindowViewModel : MyReactiveObject
|
||||
{
|
||||
public Interaction<Unit, string?> ReadTextFromClipboardInteraction { get; } = new();
|
||||
public Interaction<Unit, byte[]?> ScanScreenInteraction { get; } = new();
|
||||
public Interaction<Unit, string?> BrowseImageFileInteraction { get; } = new();
|
||||
public Interaction<bool?, Unit> ShowHideWindowInteraction { get; } = new();
|
||||
public Interaction<RxVoid, string?> ReadTextFromClipboardInteraction { get; } = new();
|
||||
public Interaction<RxVoid, byte[]?> ScanScreenInteraction { get; } = new();
|
||||
public Interaction<RxVoid, string?> BrowseImageFileInteraction { get; } = new();
|
||||
public Interaction<bool?, RxVoid> ShowHideWindowInteraction { get; } = new();
|
||||
|
||||
public bool DesignMode { get; set; }
|
||||
|
||||
@@ -22,67 +20,67 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
#region Menu
|
||||
|
||||
//servers
|
||||
public ReactiveCommand<Unit, Unit> AddVmessServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddVmessServerCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> AddVlessServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddShadowsocksServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddSocksServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddHttpServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddTrojanServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddHysteria2ServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddTuicServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddWireguardServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddAnytlsServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddNaiveServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddCustomServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddPolicyGroupServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddProxyChainServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaImageCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddVlessServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddShadowsocksServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddSocksServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddHttpServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddTrojanServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddHysteria2ServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddTuicServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddWireguardServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddAnytlsServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddNaiveServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddCustomServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddPolicyGroupServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddProxyChainServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddServerViaClipboardCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddServerViaScanCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddServerViaImageCmd { get; }
|
||||
|
||||
//Subscription
|
||||
public ReactiveCommand<Unit, Unit> SubSettingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubSettingCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SubUpdateCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubGroupUpdateCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubGroupUpdateViaProxyCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubUpdateCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubUpdateViaProxyCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubGroupUpdateCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubGroupUpdateViaProxyCmd { get; }
|
||||
|
||||
//Setting
|
||||
public ReactiveCommand<Unit, Unit> OptionSettingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> OptionSettingCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> DNSSettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> FullConfigTemplateCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RebootAsAdminCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> OpenTheFileLocationCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RoutingSettingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> DNSSettingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> FullConfigTemplateCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> GlobalHotkeySettingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RebootAsAdminCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ClearServerStatisticsCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> OpenTheFileLocationCmd { get; }
|
||||
|
||||
//Presets
|
||||
public ReactiveCommand<Unit, Unit> RegionalPresetDefaultCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RegionalPresetDefaultCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RegionalPresetRussiaCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RegionalPresetRussiaCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RegionalPresetIranCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RegionalPresetIranCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ReloadCmd { get; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlReloadEnabled { get; set; }
|
||||
public partial bool BlReloadEnabled { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool ShowClashUI { get; set; }
|
||||
public partial bool ShowClashUI { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int TabMainSelectedIndex { get; set; }
|
||||
public partial int TabMainSelectedIndex { get; set; }
|
||||
|
||||
[Reactive] public bool BlIsWindows { get; set; }
|
||||
[Reactive] public partial bool BlIsWindows { get; set; }
|
||||
|
||||
[Reactive] public bool BlNewUpdate { get; set; }
|
||||
[Reactive] public partial bool BlNewUpdate { get; set; }
|
||||
|
||||
[Reactive] public EGirdOrientation MainGirdOrientation { get; set; }
|
||||
[Reactive] public partial EGirdOrientation MainGirdOrientation { get; set; }
|
||||
|
||||
#endregion Menu
|
||||
|
||||
@@ -268,7 +266,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||
.Subscribe(async _ => await RefreshServers());
|
||||
|
||||
var vmReloadRequestedList = new List<IObservable<Unit>>
|
||||
var vmReloadRequestedList = new List<IObservable<RxVoid>>
|
||||
{
|
||||
ProfilesViewModel.ReloadRequested.AsObservable(),
|
||||
StatusBarViewModel.ReloadRequested.AsObservable(),
|
||||
@@ -407,12 +405,34 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
|
||||
private async Task RefreshServersDispatcherAsync()
|
||||
{
|
||||
await Observable.Start(async () => await RefreshServers(), RxSchedulers.MainThreadScheduler);
|
||||
//await Observable.Start(async () => await RefreshServers(), RxSchedulers.MainThreadScheduler);
|
||||
|
||||
var uiContext = SynchronizationContext.Current;
|
||||
if (uiContext != null)
|
||||
{
|
||||
var uiSequencer = new SynchronizationContextSequencer(uiContext);
|
||||
uiSequencer.Schedule(() => _ = RefreshServers());
|
||||
}
|
||||
else
|
||||
{
|
||||
await RefreshServers();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RefreshSubscriptions()
|
||||
{
|
||||
await Observable.Start(async () => await ProfilesViewModel.RefreshSubscriptions(), RxSchedulers.MainThreadScheduler);
|
||||
//await Observable.Start(async () => await ProfilesViewModel.RefreshSubscriptions(), RxSchedulers.MainThreadScheduler);
|
||||
|
||||
var uiContext = SynchronizationContext.Current;
|
||||
if (uiContext != null)
|
||||
{
|
||||
var uiSequencer = new SynchronizationContextSequencer(uiContext);
|
||||
uiSequencer.Schedule(() => _ = ProfilesViewModel.RefreshSubscriptions());
|
||||
}
|
||||
else
|
||||
{
|
||||
await ProfilesViewModel.RefreshSubscriptions();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Servers && Groups
|
||||
@@ -459,7 +479,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
var stringData = clipboardData;
|
||||
if (clipboardData == null)
|
||||
{
|
||||
var result = await ReadTextFromClipboardInteraction.Handle(Unit.Default);
|
||||
var result = await ReadTextFromClipboardInteraction.Handle(RxVoid.Default);
|
||||
if (result.IsNullOrEmpty())
|
||||
{
|
||||
NoticeManager.Instance.Enqueue(ResUI.OperationFailed);
|
||||
@@ -482,7 +502,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
|
||||
public async Task AddServerViaScanAsync()
|
||||
{
|
||||
var result = await ScanScreenInteraction.Handle(Unit.Default);
|
||||
var result = await ScanScreenInteraction.Handle(RxVoid.Default);
|
||||
await ScanScreenResult(result);
|
||||
}
|
||||
|
||||
@@ -494,7 +514,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
|
||||
public async Task AddServerViaImageAsync()
|
||||
{
|
||||
var imageFileName = await BrowseImageFileInteraction.Handle(Unit.Default);
|
||||
var imageFileName = await BrowseImageFileInteraction.Handle(RxVoid.Default);
|
||||
await AddScanResultAsync(imageFileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class MsgViewModel : MyReactiveObject
|
||||
public partial class MsgViewModel : MyReactiveObject
|
||||
{
|
||||
public Interaction<string, Unit> DispatcherShowMsgInteraction { get; } = new();
|
||||
public Interaction<string, RxVoid> DispatcherShowMsgInteraction { get; } = new();
|
||||
|
||||
private readonly ConcurrentQueue<string> _queueMsg = new();
|
||||
private volatile bool _lastMsgFilterNotAvailable;
|
||||
@@ -10,10 +10,10 @@ public class MsgViewModel : MyReactiveObject
|
||||
public int NumMaxMsg { get; } = 500;
|
||||
|
||||
[Reactive]
|
||||
public string MsgFilter { get; set; }
|
||||
public partial string MsgFilter { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AutoRefresh { get; set; }
|
||||
public partial bool AutoRefresh { get; set; }
|
||||
|
||||
public MsgViewModel()
|
||||
{
|
||||
@@ -36,6 +36,11 @@ public class MsgViewModel : MyReactiveObject
|
||||
.Subscribe(content => _ = AppendQueueMsg(content));
|
||||
}
|
||||
|
||||
public void FlushQueueMsg()
|
||||
{
|
||||
_ = AppendQueueMsg(string.Empty);
|
||||
}
|
||||
|
||||
private async Task AppendQueueMsg(string msg)
|
||||
{
|
||||
if (AutoRefresh == false)
|
||||
@@ -65,7 +70,17 @@ public class MsgViewModel : MyReactiveObject
|
||||
sb.Append(line);
|
||||
}
|
||||
|
||||
await DispatcherShowMsgInteraction.Handle(sb.ToString());
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
await DispatcherShowMsgInteraction.Handle(sb.ToString());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_queueMsg.Enqueue(sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -75,6 +90,11 @@ public class MsgViewModel : MyReactiveObject
|
||||
|
||||
private void EnqueueQueueMsg(string msg)
|
||||
{
|
||||
if (string.IsNullOrEmpty(msg))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//filter msg
|
||||
if (MsgFilter.IsNotEmpty() && !_lastMsgFilterNotAvailable)
|
||||
{
|
||||
|
||||
@@ -1,119 +1,119 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class OptionSettingViewModel : MyReactiveObject, ICloseable
|
||||
public partial class OptionSettingViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
#region Core
|
||||
|
||||
[Reactive] public int LocalPort { get; set; }
|
||||
[Reactive] public bool SecondLocalPortEnabled { get; set; }
|
||||
[Reactive] public bool UdpEnabled { get; set; }
|
||||
[Reactive] public bool SniffingEnabled { get; set; }
|
||||
[Reactive] public partial int LocalPort { get; set; }
|
||||
[Reactive] public partial bool SecondLocalPortEnabled { get; set; }
|
||||
[Reactive] public partial bool UdpEnabled { get; set; }
|
||||
[Reactive] public partial bool SniffingEnabled { get; set; }
|
||||
public IList<string> DestOverride { get; set; }
|
||||
[Reactive] public bool RouteOnly { get; set; }
|
||||
[Reactive] public bool AllowLANConn { get; set; }
|
||||
[Reactive] public bool NewPort4LAN { get; set; }
|
||||
[Reactive] public string User { get; set; }
|
||||
[Reactive] public string Pass { get; set; }
|
||||
[Reactive] public bool LogEnabled { get; set; }
|
||||
[Reactive] public string Loglevel { get; set; }
|
||||
[Reactive] public string DefFingerprint { get; set; }
|
||||
[Reactive] public string DefUserAgent { get; set; }
|
||||
[Reactive] public string SendThrough { get; set; }
|
||||
[Reactive] public string BindInterface { get; set; }
|
||||
[Reactive] public string Mux4SboxProtocol { get; set; }
|
||||
[Reactive] public bool EnableCacheFile4Sbox { get; set; }
|
||||
[Reactive] public int? HyUpMbps { get; set; }
|
||||
[Reactive] public int? HyDownMbps { get; set; }
|
||||
[Reactive] public bool EnableFragment { get; set; }
|
||||
[Reactive] public bool EnableFinalFragment { get; set; }
|
||||
[Reactive] public string FragmentPackets { get; set; }
|
||||
[Reactive] public string FragmentLengths { get; set; }
|
||||
[Reactive] public string FragmentDelays { get; set; }
|
||||
[Reactive] public string FragmentMaxSplit { get; set; }
|
||||
[Reactive] public partial bool RouteOnly { get; set; }
|
||||
[Reactive] public partial bool AllowLANConn { get; set; }
|
||||
[Reactive] public partial bool NewPort4LAN { get; set; }
|
||||
[Reactive] public partial string User { get; set; }
|
||||
[Reactive] public partial string Pass { get; set; }
|
||||
[Reactive] public partial bool LogEnabled { get; set; }
|
||||
[Reactive] public partial string Loglevel { get; set; }
|
||||
[Reactive] public partial string DefFingerprint { get; set; }
|
||||
[Reactive] public partial string DefUserAgent { get; set; }
|
||||
[Reactive] public partial string SendThrough { get; set; }
|
||||
[Reactive] public partial string BindInterface { get; set; }
|
||||
[Reactive] public partial string Mux4SboxProtocol { get; set; }
|
||||
[Reactive] public partial bool EnableCacheFile4Sbox { get; set; }
|
||||
[Reactive] public partial int? HyUpMbps { get; set; }
|
||||
[Reactive] public partial int? HyDownMbps { get; set; }
|
||||
[Reactive] public partial bool EnableFragment { get; set; }
|
||||
[Reactive] public partial bool EnableFinalFragment { get; set; }
|
||||
[Reactive] public partial string FragmentPackets { get; set; }
|
||||
[Reactive] public partial string FragmentLengths { get; set; }
|
||||
[Reactive] public partial string FragmentDelays { get; set; }
|
||||
[Reactive] public partial string FragmentMaxSplit { get; set; }
|
||||
|
||||
#endregion Core
|
||||
|
||||
#region UI
|
||||
|
||||
[Reactive] public bool AutoRun { get; set; }
|
||||
[Reactive] public bool EnableStatistics { get; set; }
|
||||
[Reactive] public bool KeepOlderDedupl { get; set; }
|
||||
[Reactive] public bool DisplayRealTimeSpeed { get; set; }
|
||||
[Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; }
|
||||
[Reactive] public bool AutoHideStartup { get; set; }
|
||||
[Reactive] public bool Hide2TrayWhenClose { get; set; }
|
||||
[Reactive] public bool MacOSShowInDock { get; set; }
|
||||
[Reactive] public bool EnableDragDropSort { get; set; }
|
||||
[Reactive] public bool DoubleClick2Activate { get; set; }
|
||||
[Reactive] public int AutoUpdateInterval { get; set; }
|
||||
[Reactive] public int TrayMenuServersLimit { get; set; }
|
||||
[Reactive] public string CurrentFontFamily { get; set; }
|
||||
[Reactive] public int SpeedTestTimeout { get; set; }
|
||||
[Reactive] public string SpeedTestUrl { get; set; }
|
||||
[Reactive] public string SpeedPingTestUrl { get; set; }
|
||||
[Reactive] public string UdpTestTarget { get; set; }
|
||||
[Reactive] public int MixedConcurrencyCount { get; set; }
|
||||
[Reactive] public bool EnableHWA { get; set; }
|
||||
[Reactive] public string SubConvertUrl { get; set; }
|
||||
[Reactive] public int MainGirdOrientation { get; set; }
|
||||
[Reactive] public string GeoFileSourceUrl { get; set; }
|
||||
[Reactive] public string SrsFileSourceUrl { get; set; }
|
||||
[Reactive] public string RoutingRulesSourceUrl { get; set; }
|
||||
[Reactive] public string IPAPIUrl { get; set; }
|
||||
[Reactive] public string RootCertProvider { get; set; }
|
||||
[Reactive] public partial bool AutoRun { get; set; }
|
||||
[Reactive] public partial bool EnableStatistics { get; set; }
|
||||
[Reactive] public partial bool KeepOlderDedupl { get; set; }
|
||||
[Reactive] public partial bool DisplayRealTimeSpeed { get; set; }
|
||||
[Reactive] public partial bool EnableAutoAdjustMainLvColWidth { get; set; }
|
||||
[Reactive] public partial bool AutoHideStartup { get; set; }
|
||||
[Reactive] public partial bool Hide2TrayWhenClose { get; set; }
|
||||
[Reactive] public partial bool MacOSShowInDock { get; set; }
|
||||
[Reactive] public partial bool EnableDragDropSort { get; set; }
|
||||
[Reactive] public partial bool DoubleClick2Activate { get; set; }
|
||||
[Reactive] public partial int AutoUpdateInterval { get; set; }
|
||||
[Reactive] public partial int TrayMenuServersLimit { get; set; }
|
||||
[Reactive] public partial string CurrentFontFamily { get; set; }
|
||||
[Reactive] public partial int SpeedTestTimeout { get; set; }
|
||||
[Reactive] public partial string SpeedTestUrl { get; set; }
|
||||
[Reactive] public partial string SpeedPingTestUrl { get; set; }
|
||||
[Reactive] public partial string UdpTestTarget { get; set; }
|
||||
[Reactive] public partial int MixedConcurrencyCount { get; set; }
|
||||
[Reactive] public partial bool EnableHWA { get; set; }
|
||||
[Reactive] public partial string SubConvertUrl { get; set; }
|
||||
[Reactive] public partial int MainGirdOrientation { get; set; }
|
||||
[Reactive] public partial string GeoFileSourceUrl { get; set; }
|
||||
[Reactive] public partial string SrsFileSourceUrl { get; set; }
|
||||
[Reactive] public partial string RoutingRulesSourceUrl { get; set; }
|
||||
[Reactive] public partial string IPAPIUrl { get; set; }
|
||||
[Reactive] public partial string RootCertProvider { get; set; }
|
||||
|
||||
#endregion UI
|
||||
|
||||
#region UI visibility
|
||||
|
||||
[Reactive] public bool BlIsWindows { get; set; }
|
||||
[Reactive] public bool BlIsLinux { get; set; }
|
||||
[Reactive] public bool BlIsIsMacOS { get; set; }
|
||||
[Reactive] public bool BlIsNonWindows { get; set; }
|
||||
[Reactive] public partial bool BlIsWindows { get; set; }
|
||||
[Reactive] public partial bool BlIsLinux { get; set; }
|
||||
[Reactive] public partial bool BlIsIsMacOS { get; set; }
|
||||
[Reactive] public partial bool BlIsNonWindows { get; set; }
|
||||
|
||||
#endregion UI visibility
|
||||
|
||||
#region System proxy
|
||||
|
||||
[Reactive] public bool NotProxyLocalAddress { get; set; }
|
||||
[Reactive] public string SystemProxyAdvancedProtocol { get; set; }
|
||||
[Reactive] public string SystemProxyExceptions { get; set; }
|
||||
[Reactive] public string CustomSystemProxyPacPath { get; set; }
|
||||
[Reactive] public string CustomSystemProxyScriptPath { get; set; }
|
||||
[Reactive] public partial bool NotProxyLocalAddress { get; set; }
|
||||
[Reactive] public partial string SystemProxyAdvancedProtocol { get; set; }
|
||||
[Reactive] public partial string SystemProxyExceptions { get; set; }
|
||||
[Reactive] public partial string CustomSystemProxyPacPath { get; set; }
|
||||
[Reactive] public partial string CustomSystemProxyScriptPath { get; set; }
|
||||
|
||||
#endregion System proxy
|
||||
|
||||
#region Tun mode
|
||||
|
||||
[Reactive] public bool TunAutoRoute { get; set; }
|
||||
[Reactive] public bool TunStrictRoute { get; set; }
|
||||
[Reactive] public string TunStack { get; set; }
|
||||
[Reactive] public int TunMtu { get; set; }
|
||||
[Reactive] public bool TunEnableIPv6Address { get; set; }
|
||||
[Reactive] public string TunIcmpRouting { get; set; }
|
||||
[Reactive] public bool TunEnableLegacyProtect { get; set; }
|
||||
[Reactive] public string TunRouteExcludeAddress { get; set; }
|
||||
[Reactive] public string TunIPv4Address { get; set; }
|
||||
[Reactive] public string TunIPv6Address { get; set; }
|
||||
[Reactive] public partial bool TunAutoRoute { get; set; }
|
||||
[Reactive] public partial bool TunStrictRoute { get; set; }
|
||||
[Reactive] public partial string TunStack { get; set; }
|
||||
[Reactive] public partial int TunMtu { get; set; }
|
||||
[Reactive] public partial bool TunEnableIPv6Address { get; set; }
|
||||
[Reactive] public partial string TunIcmpRouting { get; set; }
|
||||
[Reactive] public partial bool TunEnableLegacyProtect { get; set; }
|
||||
[Reactive] public partial string TunRouteExcludeAddress { get; set; }
|
||||
[Reactive] public partial string TunIPv4Address { get; set; }
|
||||
[Reactive] public partial string TunIPv6Address { get; set; }
|
||||
|
||||
#endregion Tun mode
|
||||
|
||||
#region CoreType
|
||||
|
||||
[Reactive] public string CoreType1 { get; set; }
|
||||
[Reactive] public string CoreType2 { get; set; }
|
||||
[Reactive] public string CoreType3 { get; set; }
|
||||
[Reactive] public string CoreType4 { get; set; }
|
||||
[Reactive] public string CoreType5 { get; set; }
|
||||
[Reactive] public string CoreType6 { get; set; }
|
||||
[Reactive] public string CoreType7 { get; set; }
|
||||
[Reactive] public string CoreType9 { get; set; }
|
||||
[Reactive] public partial string CoreType1 { get; set; }
|
||||
[Reactive] public partial string CoreType2 { get; set; }
|
||||
[Reactive] public partial string CoreType3 { get; set; }
|
||||
[Reactive] public partial string CoreType4 { get; set; }
|
||||
[Reactive] public partial string CoreType5 { get; set; }
|
||||
[Reactive] public partial string CoreType6 { get; set; }
|
||||
[Reactive] public partial string CoreType7 { get; set; }
|
||||
[Reactive] public partial string CoreType9 { get; set; }
|
||||
|
||||
#endregion CoreType
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public OptionSettingViewModel()
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class ProfilesSelectViewModel : MyReactiveObject, ICloseable
|
||||
public partial class ProfilesSelectViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
public Interaction<Unit, Unit> ProfilesFocusInteraction { get; } = new();
|
||||
|
||||
public Interaction<RxVoid, RxVoid> ProfilesFocusInteraction { get; } = new();
|
||||
|
||||
#region private prop
|
||||
|
||||
@@ -16,34 +16,34 @@ public class ProfilesSelectViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
#endregion private prop
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
#region ObservableCollection
|
||||
|
||||
public IObservableCollection<ProfileItemModel> ProfileItems { get; } = new ObservableCollectionExtended<ProfileItemModel>();
|
||||
public BulkObservableCollection<ProfileItemModel> ProfileItems { get; } = [];
|
||||
|
||||
public IObservableCollection<SubItem> SubItems { get; } = new ObservableCollectionExtended<SubItem>();
|
||||
public BulkObservableCollection<SubItem> SubItems { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public ProfileItemModel SelectedProfile { get; set; }
|
||||
public partial ProfileItemModel SelectedProfile { get; set; }
|
||||
|
||||
public IList<ProfileItemModel> SelectedProfiles { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public SubItem SelectedSub { get; set; }
|
||||
public partial SubItem SelectedSub { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string ServerFilter { get; set; }
|
||||
public partial string ServerFilter { get; set; }
|
||||
|
||||
// Include/Exclude filter for ConfigType
|
||||
[Reactive]
|
||||
public List<EConfigType> FilterConfigTypes { get; set; }
|
||||
public partial List<EConfigType> FilterConfigTypes { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool FilterExclude { get; set; }
|
||||
public partial bool FilterExclude { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool MultiSelect { get; set; }
|
||||
public partial bool MultiSelect { get; set; }
|
||||
|
||||
#endregion ObservableCollection
|
||||
|
||||
@@ -140,9 +140,9 @@ public class ProfilesSelectViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
try
|
||||
{
|
||||
await ProfilesFocusInteraction.Handle(Unit.Default);
|
||||
await ProfilesFocusInteraction.Handle(RxVoid.Default);
|
||||
}
|
||||
catch (UnhandledInteractionException<Unit, Unit>)
|
||||
catch (UnhandledInteractionException<RxVoid, RxVoid>)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class ProfilesViewModel : MyReactiveObject
|
||||
public partial class ProfilesViewModel : MyReactiveObject
|
||||
{
|
||||
public Interaction<string, bool> ShowYesNoInteraction { get; } = new();
|
||||
public Interaction<ProfileItem, bool> SaveFileDialogInteraction { get; } = new();
|
||||
public Interaction<string, Unit> SetClipboardDataInteraction { get; } = new();
|
||||
public Interaction<Unit, Unit> ProfilesFocusInteraction { get; } = new();
|
||||
public Interaction<string, Unit> ShareServerInteraction { get; } = new();
|
||||
public Interaction<Unit, Unit> DispatcherRefreshServersBizInteraction { get; } = new();
|
||||
public Interaction<Unit, Unit> AdjustMainLvColWidthInteraction { get; } = new();
|
||||
public Interaction<string, RxVoid> SetClipboardDataInteraction { get; } = new();
|
||||
public Interaction<RxVoid, RxVoid> ProfilesFocusInteraction { get; } = new();
|
||||
public Interaction<string, RxVoid> ShareServerInteraction { get; } = new();
|
||||
public Interaction<RxVoid, RxVoid> DispatcherRefreshServersBizInteraction { get; } = new();
|
||||
public Interaction<RxVoid, RxVoid> AdjustMainLvColWidthInteraction { get; } = new();
|
||||
|
||||
public EventChannel<Unit> ReloadRequested { get; } = new();
|
||||
public EventChannel<Unit> RefreshServersRequested { get; } = new();
|
||||
public EventChannel<RxVoid> ReloadRequested { get; } = new();
|
||||
public EventChannel<RxVoid> RefreshServersRequested { get; } = new();
|
||||
|
||||
#region private prop
|
||||
|
||||
@@ -25,69 +25,69 @@ public class ProfilesViewModel : MyReactiveObject
|
||||
|
||||
#region ObservableCollection
|
||||
|
||||
public IObservableCollection<ProfileItemModel> ProfileItems { get; } = new ObservableCollectionExtended<ProfileItemModel>();
|
||||
public BulkObservableCollection<ProfileItemModel> ProfileItems { get; } = [];
|
||||
|
||||
public IObservableCollection<SubItem> SubItems { get; } = new ObservableCollectionExtended<SubItem>();
|
||||
public BulkObservableCollection<SubItem> SubItems { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public ProfileItemModel SelectedProfile { get; set; }
|
||||
public partial ProfileItemModel SelectedProfile { get; set; }
|
||||
|
||||
public IList<ProfileItemModel> SelectedProfiles { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public SubItem SelectedSub { get; set; }
|
||||
public partial SubItem SelectedSub { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public SubItem SelectedMoveToGroup { get; set; }
|
||||
public partial SubItem SelectedMoveToGroup { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string ServerFilter { get; set; }
|
||||
public partial string ServerFilter { get; set; }
|
||||
|
||||
#endregion ObservableCollection
|
||||
|
||||
#region Menu
|
||||
|
||||
//servers delete
|
||||
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> EditServerCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RemoveServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RemoveDuplicateServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> CopyServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SetDefaultServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ShareServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> GenGroupAllServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> GenGroupRegionServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RemoveServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RemoveDuplicateServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> CopyServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SetDefaultServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ShareServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> GenGroupAllServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> GenGroupRegionServerCmd { get; }
|
||||
|
||||
//servers move
|
||||
public ReactiveCommand<Unit, Unit> MoveTopCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveTopCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> MoveUpCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveDownCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveBottomCmd { get; }
|
||||
public ReactiveCommand<SubItem, Unit> MoveToGroupCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveUpCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveDownCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveBottomCmd { get; }
|
||||
public ReactiveCommand<SubItem, RxVoid> MoveToGroupCmd { get; }
|
||||
|
||||
//servers ping
|
||||
public ReactiveCommand<Unit, Unit> MixedTestServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MixedTestServerCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> TcpingServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RealPingServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> UdpTestServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SpeedServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SortServerResultCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RemoveInvalidServerResultCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> FastRealPingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> TcpingServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RealPingServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> UdpTestServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SpeedServerCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SortServerResultCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RemoveInvalidServerResultCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> FastRealPingCmd { get; }
|
||||
|
||||
//servers export
|
||||
public ReactiveCommand<Unit, Unit> Export2ClientConfigCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> Export2ClientConfigCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> Export2ClientConfigClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> Export2ShareUrlCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> Export2ShareUrlBase64Cmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> Export2InnerUriCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> Export2ClientConfigClipboardCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> Export2ShareUrlCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> Export2ShareUrlBase64Cmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> Export2InnerUriCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> AddSubCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> EditSubCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> DeleteSubCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddSubCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> EditSubCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> DeleteSubCmd { get; }
|
||||
|
||||
#endregion Menu
|
||||
|
||||
@@ -347,9 +347,9 @@ public class ProfilesViewModel : MyReactiveObject
|
||||
|
||||
try
|
||||
{
|
||||
await ProfilesFocusInteraction.Handle(Unit.Default);
|
||||
await ProfilesFocusInteraction.Handle(RxVoid.Default);
|
||||
}
|
||||
catch (UnhandledInteractionException<Unit, Unit>)
|
||||
catch (UnhandledInteractionException<RxVoid, RxVoid>)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -397,9 +397,9 @@ public class ProfilesViewModel : MyReactiveObject
|
||||
|
||||
try
|
||||
{
|
||||
await DispatcherRefreshServersBizInteraction.Handle(Unit.Default);
|
||||
await DispatcherRefreshServersBizInteraction.Handle(RxVoid.Default);
|
||||
}
|
||||
catch (UnhandledInteractionException<Unit, Unit>)
|
||||
catch (UnhandledInteractionException<RxVoid, RxVoid>)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -419,7 +419,7 @@ public class ProfilesViewModel : MyReactiveObject
|
||||
|
||||
public async Task AdjustMainLvColWidth()
|
||||
{
|
||||
await AdjustMainLvColWidthInteraction.Handle(Unit.Default);
|
||||
await AdjustMainLvColWidthInteraction.Handle(RxVoid.Default);
|
||||
}
|
||||
|
||||
private async Task<List<ProfileItemModel>?> GetProfileItemsEx(string subid, string filter)
|
||||
@@ -761,10 +761,9 @@ public class ProfilesViewModel : MyReactiveObject
|
||||
|
||||
_speedtestService ??= new SpeedtestService(_config, async (SpeedTestResult result) =>
|
||||
{
|
||||
RxSchedulers.MainThreadScheduler.Schedule(result, (scheduler, result) =>
|
||||
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
_ = SetSpeedTestResult(result);
|
||||
return Disposable.Empty;
|
||||
});
|
||||
await Task.CompletedTask;
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class RoutingRuleDetailsViewModel : MyReactiveObject, ICloseable
|
||||
public partial class RoutingRuleDetailsViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
@@ -8,25 +8,25 @@ public class RoutingRuleDetailsViewModel : MyReactiveObject, ICloseable
|
||||
public IList<string> InboundTagItems { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public RulesItem SelectedSource { get; set; }
|
||||
public partial RulesItem SelectedSource { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Domain { get; set; }
|
||||
public partial string Domain { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string IP { get; set; }
|
||||
public partial string IP { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Process { get; set; }
|
||||
public partial string Process { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? RuleType { get; set; }
|
||||
public partial string? RuleType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AutoSort { get; set; }
|
||||
public partial bool AutoSort { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SelectProfileCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SelectProfileCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public RoutingRuleDetailsViewModel(RulesItem rulesItem)
|
||||
{
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class RoutingRuleSettingViewModel : MyReactiveObject, ICloseable
|
||||
public partial class RoutingRuleSettingViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
public Interaction<string, bool> ShowYesNoInteraction { get; } = new();
|
||||
public Interaction<string, Unit> SetClipboardDataInteraction { get; } = new();
|
||||
public Interaction<Unit, string?> ReadTextFromClipboardInteraction { get; } = new();
|
||||
public Interaction<Unit, string?> BrowseRulesFileInteraction { get; } = new();
|
||||
public Interaction<string, RxVoid> SetClipboardDataInteraction { get; } = new();
|
||||
public Interaction<RxVoid, string?> ReadTextFromClipboardInteraction { get; } = new();
|
||||
public Interaction<RxVoid, string?> BrowseRulesFileInteraction { get; } = new();
|
||||
|
||||
private List<RulesItem> _rules;
|
||||
|
||||
[Reactive]
|
||||
public RoutingItem SelectedRouting { get; set; }
|
||||
public partial RoutingItem SelectedRouting { get; set; }
|
||||
|
||||
public IObservableCollection<RulesItemModel> RulesItems { get; } = new ObservableCollectionExtended<RulesItemModel>();
|
||||
public BulkObservableCollection<RulesItemModel> RulesItems { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public RulesItemModel SelectedSource { get; set; }
|
||||
public partial RulesItemModel SelectedSource { get; set; }
|
||||
|
||||
public IList<RulesItemModel> SelectedSources { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RuleAddCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportRulesFromFileCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportRulesFromClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportRulesFromUrlCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RuleRemoveCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RuleExportSelectedCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveTopCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveUpCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveDownCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> MoveBottomCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RuleAddCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ImportRulesFromFileCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ImportRulesFromClipboardCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ImportRulesFromUrlCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RuleRemoveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RuleExportSelectedCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveTopCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveUpCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveDownCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> MoveBottomCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public RoutingRuleSettingViewModel(RoutingItem routingItem)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public class RoutingRuleSettingViewModel : MyReactiveObject, ICloseable
|
||||
});
|
||||
ImportRulesFromFileCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
var fileName = await BrowseRulesFileInteraction.Handle(Unit.Default);
|
||||
var fileName = await BrowseRulesFileInteraction.Handle(RxVoid.Default);
|
||||
await ImportRulesFromFileAsync(fileName);
|
||||
});
|
||||
ImportRulesFromClipboardCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
@@ -277,7 +277,7 @@ public class RoutingRuleSettingViewModel : MyReactiveObject, ICloseable
|
||||
var stringData = clipboardData;
|
||||
if (clipboardData == null)
|
||||
{
|
||||
var result = await ReadTextFromClipboardInteraction.Handle(Unit.Default);
|
||||
var result = await ReadTextFromClipboardInteraction.Handle(RxVoid.Default);
|
||||
if (result.IsNullOrEmpty())
|
||||
{
|
||||
NoticeManager.Instance.Enqueue(ResUI.OperationFailed);
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class RoutingSettingViewModel : MyReactiveObject
|
||||
public partial class RoutingSettingViewModel : MyReactiveObject
|
||||
{
|
||||
public Interaction<string, bool> ShowYesNoInteraction { get; } = new();
|
||||
|
||||
#region Reactive
|
||||
|
||||
public IObservableCollection<RoutingItemModel> RoutingItems { get; } = new ObservableCollectionExtended<RoutingItemModel>();
|
||||
public BulkObservableCollection<RoutingItemModel> RoutingItems { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public RoutingItemModel SelectedSource { get; set; }
|
||||
public partial RoutingItemModel SelectedSource { get; set; }
|
||||
|
||||
public IList<RoutingItemModel> SelectedSources { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string DomainStrategy { get; set; }
|
||||
public partial string DomainStrategy { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string DomainStrategy4Singbox { get; set; }
|
||||
public partial string DomainStrategy4Singbox { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RoutingAdvancedAddCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RoutingAdvancedRemoveCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RoutingAdvancedSetDefaultCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RoutingAdvancedImportRulesCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RoutingAdvancedAddCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RoutingAdvancedRemoveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RoutingAdvancedSetDefaultCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> RoutingAdvancedImportRulesCmd { get; }
|
||||
|
||||
public bool IsModified { get; set; }
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class StatusBarViewModel : MyReactiveObject
|
||||
public partial class StatusBarViewModel : MyReactiveObject
|
||||
{
|
||||
public Interaction<string, Unit> SetClipboardDataInteraction { get; } = new();
|
||||
public Interaction<Unit, string?> PasswordInputInteraction { get; } = new();
|
||||
public Interaction<Unit, Unit> DispatcherRefreshIconInteraction { get; } = new();
|
||||
public Interaction<string, RxVoid> SetClipboardDataInteraction { get; } = new();
|
||||
public Interaction<RxVoid, string?> PasswordInputInteraction { get; } = new();
|
||||
public Interaction<RxVoid, RxVoid> DispatcherRefreshIconInteraction { get; } = new();
|
||||
public EventChannel<bool> SubscriptionsUpdateRequested { get; } = new();
|
||||
public EventChannel<bool?> ShowHideWindowRequested { get; } = new();
|
||||
|
||||
@@ -12,94 +12,94 @@ public class StatusBarViewModel : MyReactiveObject
|
||||
public static StatusBarViewModel Instance => _instance.Value;
|
||||
|
||||
public EventChannel<string> SetDefaultServerRequested { get; } = new();
|
||||
public EventChannel<Unit> ReloadRequested { get; } = new();
|
||||
public EventChannel<Unit> AddServerViaScanRequested { get; } = new();
|
||||
public EventChannel<Unit> AddServerViaClipboardRequested { get; } = new();
|
||||
public EventChannel<RxVoid> ReloadRequested { get; } = new();
|
||||
public EventChannel<RxVoid> AddServerViaScanRequested { get; } = new();
|
||||
public EventChannel<RxVoid> AddServerViaClipboardRequested { get; } = new();
|
||||
|
||||
#region ObservableCollection
|
||||
|
||||
public IObservableCollection<RoutingItem> RoutingItems { get; } = new ObservableCollectionExtended<RoutingItem>();
|
||||
public BulkObservableCollection<RoutingItem> RoutingItems { get; } = [];
|
||||
|
||||
public IObservableCollection<ComboItem> Servers { get; } = new ObservableCollectionExtended<ComboItem>();
|
||||
public BulkObservableCollection<ComboItem> Servers { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public RoutingItem SelectedRouting { get; set; }
|
||||
public partial RoutingItem SelectedRouting { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public ComboItem SelectedServer { get; set; }
|
||||
public partial ComboItem SelectedServer { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlServers { get; set; }
|
||||
public partial bool BlServers { get; set; }
|
||||
|
||||
#endregion ObservableCollection
|
||||
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubUpdateCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> CopyProxyCmdToClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ShowWindowCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> HideWindowCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddServerViaClipboardCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> AddServerViaScanCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubUpdateCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubUpdateViaProxyCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> CopyProxyCmdToClipboardCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> NotifyLeftClickCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ShowWindowCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> HideWindowCmd { get; }
|
||||
|
||||
#region System Proxy
|
||||
|
||||
[Reactive]
|
||||
public bool BlSystemProxyClear { get; set; }
|
||||
public partial bool BlSystemProxyClear { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlSystemProxySet { get; set; }
|
||||
public partial bool BlSystemProxySet { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlSystemProxyNothing { get; set; }
|
||||
public partial bool BlSystemProxyNothing { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlSystemProxyPac { get; set; }
|
||||
public partial bool BlSystemProxyPac { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SystemProxyClearCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SystemProxySetCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SystemProxyNothingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SystemProxyPacCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SystemProxyClearCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SystemProxySetCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SystemProxyNothingCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SystemProxyPacCmd { get; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlRouting { get; set; }
|
||||
public partial bool BlRouting { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public int SystemProxySelected { get; set; }
|
||||
public partial int SystemProxySelected { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlSystemProxyPacVisible { get; set; }
|
||||
public partial bool BlSystemProxyPacVisible { get; set; }
|
||||
|
||||
#endregion System Proxy
|
||||
|
||||
#region UI
|
||||
|
||||
[Reactive]
|
||||
public string InboundDisplay { get; set; }
|
||||
public partial string InboundDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string InboundLanDisplay { get; set; }
|
||||
public partial string InboundLanDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string RunningServerDisplay { get; set; }
|
||||
public partial string RunningServerDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string RunningServerToolTipText { get; set; }
|
||||
public partial string RunningServerToolTipText { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string RunningInfoDisplay { get; set; }
|
||||
public partial string RunningInfoDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string SpeedProxyDisplay { get; set; }
|
||||
public partial string SpeedProxyDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string SpeedDirectDisplay { get; set; }
|
||||
public partial string SpeedDirectDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool EnableTun { get; set; }
|
||||
public partial bool EnableTun { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlIsNonWindows { get; set; }
|
||||
public partial bool BlIsNonWindows { get; set; }
|
||||
|
||||
#endregion UI
|
||||
|
||||
@@ -349,10 +349,9 @@ public class StatusBarViewModel : MyReactiveObject
|
||||
|
||||
private async Task TestServerAvailabilitySub(string msg)
|
||||
{
|
||||
RxSchedulers.MainThreadScheduler.Schedule(msg, (scheduler, msg) =>
|
||||
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
_ = TestServerAvailabilityResult(msg);
|
||||
return Disposable.Empty;
|
||||
});
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
@@ -392,9 +391,9 @@ public class StatusBarViewModel : MyReactiveObject
|
||||
{
|
||||
try
|
||||
{
|
||||
await DispatcherRefreshIconInteraction.Handle(Unit.Default);
|
||||
await DispatcherRefreshIconInteraction.Handle(RxVoid.Default);
|
||||
}
|
||||
catch (UnhandledInteractionException<Unit, Unit>)
|
||||
catch (UnhandledInteractionException<RxVoid, RxVoid>)
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
@@ -433,7 +432,7 @@ public class StatusBarViewModel : MyReactiveObject
|
||||
{
|
||||
NoticeManager.Instance.SendMessageEx(ResUI.TipChangeRouting);
|
||||
ReloadRequested.Publish();
|
||||
await DispatcherRefreshIconInteraction.Handle(Unit.Default);
|
||||
await DispatcherRefreshIconInteraction.Handle(RxVoid.Default);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +469,7 @@ public class StatusBarViewModel : MyReactiveObject
|
||||
}
|
||||
else
|
||||
{
|
||||
var password = await PasswordInputInteraction.Handle(Unit.Default);
|
||||
var password = await PasswordInputInteraction.Handle(RxVoid.Default);
|
||||
if (password.IsNullOrEmpty())
|
||||
{
|
||||
_config.TunModeItem.EnableTun = false;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
public partial class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
{
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
[Reactive]
|
||||
public SubItem SelectedSource { get; set; }
|
||||
public partial SubItem SelectedSource { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SelectPrevProfileCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SelectNextProfileCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SelectPrevProfileCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SelectNextProfileCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
|
||||
public SubEditViewModel(SubItem subItem)
|
||||
{
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public class SubSettingViewModel : MyReactiveObject
|
||||
public partial class SubSettingViewModel : MyReactiveObject
|
||||
{
|
||||
public Interaction<string, bool> ShowYesNoInteraction { get; } = new();
|
||||
public Interaction<string, Unit> ShareSubInteraction { get; } = new();
|
||||
public Interaction<string, RxVoid> ShareSubInteraction { get; } = new();
|
||||
|
||||
public IObservableCollection<SubItem> SubItems { get; } = new ObservableCollectionExtended<SubItem>();
|
||||
public BulkObservableCollection<SubItem> SubItems { get; } = [];
|
||||
|
||||
[Reactive]
|
||||
public SubItem SelectedSource { get; set; }
|
||||
public partial SubItem SelectedSource { get; set; }
|
||||
|
||||
public IList<SubItem> SelectedSources { get; set; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SubAddCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubDeleteCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubEditCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SubShareCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubAddCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubDeleteCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubEditCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SubShareCmd { get; }
|
||||
public bool IsModified { get; set; }
|
||||
|
||||
public SubSettingViewModel()
|
||||
|
||||
Reference in New Issue
Block a user