|
|
@ -2,10 +2,12 @@
|
|
|
|
using DownKyi.Core.Settings;
|
|
|
|
using DownKyi.Core.Settings;
|
|
|
|
using DownKyi.Core.Utils.Validator;
|
|
|
|
using DownKyi.Core.Utils.Validator;
|
|
|
|
using DownKyi.Events;
|
|
|
|
using DownKyi.Events;
|
|
|
|
|
|
|
|
using DownKyi.Services;
|
|
|
|
using DownKyi.Utils;
|
|
|
|
using DownKyi.Utils;
|
|
|
|
using Prism.Commands;
|
|
|
|
using Prism.Commands;
|
|
|
|
using Prism.Events;
|
|
|
|
using Prism.Events;
|
|
|
|
using Prism.Regions;
|
|
|
|
using Prism.Regions;
|
|
|
|
|
|
|
|
using Prism.Services.Dialogs;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DownKyi.ViewModels.Settings
|
|
|
|
namespace DownKyi.ViewModels.Settings
|
|
|
@ -18,111 +20,182 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
|
|
|
|
|
|
|
#region 页面属性申明
|
|
|
|
#region 页面属性申明
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool builtin;
|
|
|
|
|
|
|
|
public bool Builtin
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => builtin;
|
|
|
|
|
|
|
|
set => SetProperty(ref builtin, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool aria2c;
|
|
|
|
|
|
|
|
public bool Aria2c
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => aria2c;
|
|
|
|
|
|
|
|
set => SetProperty(ref aria2c, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<int> maxCurrentDownloads;
|
|
|
|
|
|
|
|
public List<int> MaxCurrentDownloads
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => maxCurrentDownloads;
|
|
|
|
|
|
|
|
set => SetProperty(ref maxCurrentDownloads, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int selectedMaxCurrentDownload;
|
|
|
|
|
|
|
|
public int SelectedMaxCurrentDownload
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => selectedMaxCurrentDownload;
|
|
|
|
|
|
|
|
set => SetProperty(ref selectedMaxCurrentDownload, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<int> splits;
|
|
|
|
|
|
|
|
public List<int> Splits
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => splits;
|
|
|
|
|
|
|
|
set => SetProperty(ref splits, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int selectedSplit;
|
|
|
|
|
|
|
|
public int SelectedSplit
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => selectedSplit;
|
|
|
|
|
|
|
|
set => SetProperty(ref selectedSplit, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool isHttpProxy;
|
|
|
|
|
|
|
|
public bool IsHttpProxy
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => isHttpProxy;
|
|
|
|
|
|
|
|
set => SetProperty(ref isHttpProxy, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string httpProxy;
|
|
|
|
|
|
|
|
public string HttpProxy
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => httpProxy;
|
|
|
|
|
|
|
|
set => SetProperty(ref httpProxy, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int httpProxyPort;
|
|
|
|
|
|
|
|
public int HttpProxyPort
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => httpProxyPort;
|
|
|
|
|
|
|
|
set => SetProperty(ref httpProxyPort, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int ariaListenPort;
|
|
|
|
private int ariaListenPort;
|
|
|
|
public int AriaListenPort
|
|
|
|
public int AriaListenPort
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaListenPort; }
|
|
|
|
get => ariaListenPort;
|
|
|
|
set { SetProperty(ref ariaListenPort, value); }
|
|
|
|
set => SetProperty(ref ariaListenPort, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<string> ariaLogLevels;
|
|
|
|
private List<string> ariaLogLevels;
|
|
|
|
public List<string> AriaLogLevels
|
|
|
|
public List<string> AriaLogLevels
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaLogLevels; }
|
|
|
|
get => ariaLogLevels;
|
|
|
|
set { SetProperty(ref ariaLogLevels, value); }
|
|
|
|
set => SetProperty(ref ariaLogLevels, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string selectedAriaLogLevel;
|
|
|
|
private string selectedAriaLogLevel;
|
|
|
|
public string SelectedAriaLogLevel
|
|
|
|
public string SelectedAriaLogLevel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return selectedAriaLogLevel; }
|
|
|
|
get => selectedAriaLogLevel;
|
|
|
|
set { SetProperty(ref selectedAriaLogLevel, value); }
|
|
|
|
set => SetProperty(ref selectedAriaLogLevel, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<int> ariaMaxConcurrentDownloads;
|
|
|
|
private List<int> ariaMaxConcurrentDownloads;
|
|
|
|
public List<int> AriaMaxConcurrentDownloads
|
|
|
|
public List<int> AriaMaxConcurrentDownloads
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaMaxConcurrentDownloads; }
|
|
|
|
get => ariaMaxConcurrentDownloads;
|
|
|
|
set { SetProperty(ref ariaMaxConcurrentDownloads, value); }
|
|
|
|
set => SetProperty(ref ariaMaxConcurrentDownloads, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int selectedAriaMaxConcurrentDownload;
|
|
|
|
private int selectedAriaMaxConcurrentDownload;
|
|
|
|
public int SelectedAriaMaxConcurrentDownload
|
|
|
|
public int SelectedAriaMaxConcurrentDownload
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return selectedAriaMaxConcurrentDownload; }
|
|
|
|
get => selectedAriaMaxConcurrentDownload;
|
|
|
|
set { SetProperty(ref selectedAriaMaxConcurrentDownload, value); }
|
|
|
|
set => SetProperty(ref selectedAriaMaxConcurrentDownload, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<int> ariaSplits;
|
|
|
|
private List<int> ariaSplits;
|
|
|
|
public List<int> AriaSplits
|
|
|
|
public List<int> AriaSplits
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaSplits; }
|
|
|
|
get => ariaSplits;
|
|
|
|
set { SetProperty(ref ariaSplits, value); }
|
|
|
|
set => SetProperty(ref ariaSplits, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int selectedAriaSplit;
|
|
|
|
private int selectedAriaSplit;
|
|
|
|
public int SelectedAriaSplit
|
|
|
|
public int SelectedAriaSplit
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return selectedAriaSplit; }
|
|
|
|
get => selectedAriaSplit;
|
|
|
|
set { SetProperty(ref selectedAriaSplit, value); }
|
|
|
|
set => SetProperty(ref selectedAriaSplit, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int ariaMaxOverallDownloadLimit;
|
|
|
|
private int ariaMaxOverallDownloadLimit;
|
|
|
|
public int AriaMaxOverallDownloadLimit
|
|
|
|
public int AriaMaxOverallDownloadLimit
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaMaxOverallDownloadLimit; }
|
|
|
|
get => ariaMaxOverallDownloadLimit;
|
|
|
|
set { SetProperty(ref ariaMaxOverallDownloadLimit, value); }
|
|
|
|
set => SetProperty(ref ariaMaxOverallDownloadLimit, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int ariaMaxDownloadLimit;
|
|
|
|
private int ariaMaxDownloadLimit;
|
|
|
|
public int AriaMaxDownloadLimit
|
|
|
|
public int AriaMaxDownloadLimit
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaMaxDownloadLimit; }
|
|
|
|
get => ariaMaxDownloadLimit;
|
|
|
|
set { SetProperty(ref ariaMaxDownloadLimit, value); }
|
|
|
|
set => SetProperty(ref ariaMaxDownloadLimit, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool isAriaHttpProxy;
|
|
|
|
private bool isAriaHttpProxy;
|
|
|
|
public bool IsAriaHttpProxy
|
|
|
|
public bool IsAriaHttpProxy
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return isAriaHttpProxy; }
|
|
|
|
get => isAriaHttpProxy;
|
|
|
|
set { SetProperty(ref isAriaHttpProxy, value); }
|
|
|
|
set => SetProperty(ref isAriaHttpProxy, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string ariaHttpProxy;
|
|
|
|
private string ariaHttpProxy;
|
|
|
|
public string AriaHttpProxy
|
|
|
|
public string AriaHttpProxy
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaHttpProxy; }
|
|
|
|
get => ariaHttpProxy;
|
|
|
|
set { SetProperty(ref ariaHttpProxy, value); }
|
|
|
|
set => SetProperty(ref ariaHttpProxy, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int ariaHttpProxyPort;
|
|
|
|
private int ariaHttpProxyPort;
|
|
|
|
public int AriaHttpProxyPort
|
|
|
|
public int AriaHttpProxyPort
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaHttpProxyPort; }
|
|
|
|
get => ariaHttpProxyPort;
|
|
|
|
set { SetProperty(ref ariaHttpProxyPort, value); }
|
|
|
|
set => SetProperty(ref ariaHttpProxyPort, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<string> ariaFileAllocations;
|
|
|
|
private List<string> ariaFileAllocations;
|
|
|
|
public List<string> AriaFileAllocations
|
|
|
|
public List<string> AriaFileAllocations
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return ariaFileAllocations; }
|
|
|
|
get => ariaFileAllocations;
|
|
|
|
set { SetProperty(ref ariaFileAllocations, value); }
|
|
|
|
set => SetProperty(ref ariaFileAllocations, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string selectedAriaFileAllocation;
|
|
|
|
private string selectedAriaFileAllocation;
|
|
|
|
public string SelectedAriaFileAllocation
|
|
|
|
public string SelectedAriaFileAllocation
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return selectedAriaFileAllocation; }
|
|
|
|
get => selectedAriaFileAllocation;
|
|
|
|
set { SetProperty(ref selectedAriaFileAllocation, value); }
|
|
|
|
set => SetProperty(ref selectedAriaFileAllocation, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public ViewNetworkViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
|
|
|
|
public ViewNetworkViewModel(IEventAggregator eventAggregator, IDialogService dialogService) : base(eventAggregator, dialogService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
#region 属性初始化
|
|
|
|
#region 属性初始化
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin同时下载数
|
|
|
|
|
|
|
|
MaxCurrentDownloads = new List<int>();
|
|
|
|
|
|
|
|
for (int i = 1; i <= 10; i++) { MaxCurrentDownloads.Add(i); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin最大线程数
|
|
|
|
|
|
|
|
Splits = new List<int>();
|
|
|
|
|
|
|
|
for (int i = 1; i <= 10; i++) { Splits.Add(i); }
|
|
|
|
|
|
|
|
|
|
|
|
// Aria的日志等级
|
|
|
|
// Aria的日志等级
|
|
|
|
AriaLogLevels = new List<string>
|
|
|
|
AriaLogLevels = new List<string>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -154,7 +227,7 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 导航到VideoDetail页面时执行
|
|
|
|
/// 导航到页面时执行
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="navigationContext"></param>
|
|
|
|
/// <param name="navigationContext"></param>
|
|
|
|
public override void OnNavigatedTo(NavigationContext navigationContext)
|
|
|
|
public override void OnNavigatedTo(NavigationContext navigationContext)
|
|
|
@ -163,6 +236,36 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
|
|
|
|
|
|
|
isOnNavigatedTo = true;
|
|
|
|
isOnNavigatedTo = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 选择下载器
|
|
|
|
|
|
|
|
var downloader = SettingsManager.GetInstance().GetDownloader();
|
|
|
|
|
|
|
|
switch (downloader)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case Downloader.NOT_SET:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Downloader.BUILT_IN:
|
|
|
|
|
|
|
|
Builtin = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Downloader.ARIA:
|
|
|
|
|
|
|
|
Aria2c = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin同时下载数
|
|
|
|
|
|
|
|
SelectedMaxCurrentDownload = SettingsManager.GetInstance().GetMaxCurrentDownloads();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin最大线程数
|
|
|
|
|
|
|
|
SelectedSplit = SettingsManager.GetInstance().GetSplit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 是否开启builtin http代理
|
|
|
|
|
|
|
|
AllowStatus isHttpProxy = SettingsManager.GetInstance().IsHttpProxy();
|
|
|
|
|
|
|
|
IsHttpProxy = isHttpProxy == AllowStatus.YES;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin的http代理的地址
|
|
|
|
|
|
|
|
HttpProxy = SettingsManager.GetInstance().GetHttpProxy();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin的http代理的端口
|
|
|
|
|
|
|
|
HttpProxyPort = SettingsManager.GetInstance().GetHttpProxyListenPort();
|
|
|
|
|
|
|
|
|
|
|
|
// Aria服务器端口
|
|
|
|
// Aria服务器端口
|
|
|
|
AriaListenPort = SettingsManager.GetInstance().GetAriaListenPort();
|
|
|
|
AriaListenPort = SettingsManager.GetInstance().GetAriaListenPort();
|
|
|
|
|
|
|
|
|
|
|
@ -171,7 +274,7 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
SelectedAriaLogLevel = ariaLogLevel.ToString("G");
|
|
|
|
SelectedAriaLogLevel = ariaLogLevel.ToString("G");
|
|
|
|
|
|
|
|
|
|
|
|
// Aria同时下载数
|
|
|
|
// Aria同时下载数
|
|
|
|
SelectedAriaMaxConcurrentDownload = SettingsManager.GetInstance().GetAriaMaxConcurrentDownloads();
|
|
|
|
SelectedAriaMaxConcurrentDownload = SettingsManager.GetInstance().GetMaxCurrentDownloads();
|
|
|
|
|
|
|
|
|
|
|
|
// Aria最大线程数
|
|
|
|
// Aria最大线程数
|
|
|
|
SelectedAriaSplit = SettingsManager.GetInstance().GetAriaSplit();
|
|
|
|
SelectedAriaSplit = SettingsManager.GetInstance().GetAriaSplit();
|
|
|
@ -201,6 +304,120 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
|
|
|
|
|
|
|
#region 命令申明
|
|
|
|
#region 命令申明
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 下载器选择事件
|
|
|
|
|
|
|
|
private DelegateCommand<string> selectDownloaderCommand;
|
|
|
|
|
|
|
|
public DelegateCommand<string> SelectDownloaderCommand => selectDownloaderCommand ?? (selectDownloaderCommand = new DelegateCommand<string>(ExecuteSelectDownloaderCommand));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 下载器选择事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="parameter"></param>
|
|
|
|
|
|
|
|
private void ExecuteSelectDownloaderCommand(string parameter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Downloader downloader;
|
|
|
|
|
|
|
|
switch (parameter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case "Builtin":
|
|
|
|
|
|
|
|
downloader = Downloader.BUILT_IN;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "Aria2c":
|
|
|
|
|
|
|
|
downloader = Downloader.ARIA;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
downloader = SettingsManager.GetInstance().GetDownloader();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetDownloader(downloader);
|
|
|
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AlertService alertService = new AlertService(dialogService);
|
|
|
|
|
|
|
|
ButtonResult result = alertService.ShowInfo(DictionaryResource.GetString("ConfirmReboot"));
|
|
|
|
|
|
|
|
if (result == ButtonResult.OK)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
System.Windows.Application.Current.Shutdown();
|
|
|
|
|
|
|
|
System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin同时下载数事件
|
|
|
|
|
|
|
|
private DelegateCommand<object> maxCurrentDownloadsCommand;
|
|
|
|
|
|
|
|
public DelegateCommand<object> MaxCurrentDownloadsCommand => maxCurrentDownloadsCommand ?? (maxCurrentDownloadsCommand = new DelegateCommand<object>(ExecuteMaxCurrentDownloadsCommand));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// builtin同时下载数事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="parameter"></param>
|
|
|
|
|
|
|
|
private void ExecuteMaxCurrentDownloadsCommand(object parameter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SelectedMaxCurrentDownload = (int)parameter;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetMaxCurrentDownloads(SelectedMaxCurrentDownload);
|
|
|
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin最大线程数事件
|
|
|
|
|
|
|
|
private DelegateCommand<object> splitsCommand;
|
|
|
|
|
|
|
|
public DelegateCommand<object> SplitsCommand => splitsCommand ?? (splitsCommand = new DelegateCommand<object>(ExecuteSplitsCommand));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// builtin最大线程数事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="parameter"></param>
|
|
|
|
|
|
|
|
private void ExecuteSplitsCommand(object parameter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SelectedSplit = (int)parameter;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetSplit(SelectedSplit);
|
|
|
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 是否开启builtin http代理事件
|
|
|
|
|
|
|
|
private DelegateCommand isHttpProxyCommand;
|
|
|
|
|
|
|
|
public DelegateCommand IsHttpProxyCommand => isHttpProxyCommand ?? (isHttpProxyCommand = new DelegateCommand(ExecuteIsHttpProxyCommand));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 是否开启builtin http代理事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
private void ExecuteIsHttpProxyCommand()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AllowStatus isHttpProxy = IsHttpProxy ? AllowStatus.YES : AllowStatus.NO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().IsHttpProxy(isHttpProxy);
|
|
|
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin的http代理的地址事件
|
|
|
|
|
|
|
|
private DelegateCommand<string> httpProxyCommand;
|
|
|
|
|
|
|
|
public DelegateCommand<string> HttpProxyCommand => httpProxyCommand ?? (httpProxyCommand = new DelegateCommand<string>(ExecuteHttpProxyCommand));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// builtin的http代理的地址事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="parameter"></param>
|
|
|
|
|
|
|
|
private void ExecuteHttpProxyCommand(string parameter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetHttpProxy(parameter);
|
|
|
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// builtin的http代理的端口事件
|
|
|
|
|
|
|
|
private DelegateCommand<string> httpProxyPortCommand;
|
|
|
|
|
|
|
|
public DelegateCommand<string> HttpProxyPortCommand => httpProxyPortCommand ?? (httpProxyPortCommand = new DelegateCommand<string>(ExecuteHttpProxyPortCommand));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// builtin的http代理的端口事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="parameter"></param>
|
|
|
|
|
|
|
|
private void ExecuteHttpProxyPortCommand(string parameter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int httpProxyPort = (int)Number.GetInt(parameter);
|
|
|
|
|
|
|
|
HttpProxyPort = httpProxyPort;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetHttpProxyListenPort(HttpProxyPort);
|
|
|
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Aria服务器端口事件
|
|
|
|
// Aria服务器端口事件
|
|
|
|
private DelegateCommand<string> ariaListenPortCommand;
|
|
|
|
private DelegateCommand<string> ariaListenPortCommand;
|
|
|
|
public DelegateCommand<string> AriaListenPortCommand => ariaListenPortCommand ?? (ariaListenPortCommand = new DelegateCommand<string>(ExecuteAriaListenPortCommand));
|
|
|
|
public DelegateCommand<string> AriaListenPortCommand => ariaListenPortCommand ?? (ariaListenPortCommand = new DelegateCommand<string>(ExecuteAriaListenPortCommand));
|
|
|
@ -267,7 +484,7 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SelectedAriaMaxConcurrentDownload = (int)parameter;
|
|
|
|
SelectedAriaMaxConcurrentDownload = (int)parameter;
|
|
|
|
|
|
|
|
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetAriaMaxConcurrentDownloads(SelectedAriaMaxConcurrentDownload);
|
|
|
|
bool isSucceed = SettingsManager.GetInstance().SetMaxCurrentDownloads(SelectedAriaMaxConcurrentDownload);
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|