|
|
|
@ -74,6 +74,22 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
set => SetProperty(ref autoDownloadAll, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<RepeatDownloadStrategyDisplay> _repeatDownloadStrategy;
|
|
|
|
|
|
|
|
|
|
public List<RepeatDownloadStrategyDisplay> RepeatDownloadStrategy
|
|
|
|
|
{
|
|
|
|
|
get => _repeatDownloadStrategy;
|
|
|
|
|
set => SetProperty(ref _repeatDownloadStrategy, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private RepeatDownloadStrategyDisplay _selectedRepeatDownloadStrategy;
|
|
|
|
|
|
|
|
|
|
public RepeatDownloadStrategyDisplay SelectedRepeatDownloadStrategy
|
|
|
|
|
{
|
|
|
|
|
get => _selectedRepeatDownloadStrategy;
|
|
|
|
|
set => SetProperty(ref _selectedRepeatDownloadStrategy, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public ViewBasicViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
|
|
|
|
@ -90,6 +106,14 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
new ParseScopeDisplay{ Name = DictionaryResource.GetString("ParseAll"), ParseScope = ParseScope.ALL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 重复下载策略
|
|
|
|
|
RepeatDownloadStrategy = new List<RepeatDownloadStrategyDisplay>
|
|
|
|
|
{
|
|
|
|
|
new RepeatDownloadStrategyDisplay { Name = DictionaryResource.GetString("RepeatDownloadAsk"), RepeatDownloadStrategy = Core.Settings.RepeatDownloadStrategy.Ask },
|
|
|
|
|
new RepeatDownloadStrategyDisplay { Name = DictionaryResource.GetString("RepeatDownloadReDownload"), RepeatDownloadStrategy = Core.Settings.RepeatDownloadStrategy.ReDownload },
|
|
|
|
|
new RepeatDownloadStrategyDisplay { Name = DictionaryResource.GetString("RepeatDownloadReJumpOver"), RepeatDownloadStrategy = Core.Settings.RepeatDownloadStrategy.JumpOver }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -124,6 +148,10 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
AllowStatus isAutoDownloadAll = SettingsManager.GetInstance().IsAutoDownloadAll();
|
|
|
|
|
AutoDownloadAll = isAutoDownloadAll == AllowStatus.YES;
|
|
|
|
|
|
|
|
|
|
// 重复下载策略
|
|
|
|
|
var repeatDownloadStrategy = SettingsManager.GetInstance().GetRepeatDownloadStrategy();
|
|
|
|
|
SelectedRepeatDownloadStrategy = RepeatDownloadStrategy.FirstOrDefault(t => t.RepeatDownloadStrategy == repeatDownloadStrategy);
|
|
|
|
|
|
|
|
|
|
isOnNavigatedTo = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -219,6 +247,26 @@ namespace DownKyi.ViewModels.Settings
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 解析范围事件
|
|
|
|
|
private DelegateCommand<object> _repeatDownloadStrategyCommand;
|
|
|
|
|
|
|
|
|
|
public DelegateCommand<object> RepeatDownloadStrategyCommand => _repeatDownloadStrategyCommand ?? (_repeatDownloadStrategyCommand = new DelegateCommand<object>(ExecuteRepeatDownloadStrategyCommand));
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 解析范围事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="parameter"></param>
|
|
|
|
|
private void ExecuteRepeatDownloadStrategyCommand(object parameter)
|
|
|
|
|
{
|
|
|
|
|
if (!(parameter is RepeatDownloadStrategyDisplay repeatDownloadStrategy))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var isSucceed = SettingsManager.GetInstance().SetRepeatDownloadStrategy(repeatDownloadStrategy.RepeatDownloadStrategy);
|
|
|
|
|
PublishTip(isSucceed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|