namespace DownKyi.Core.Settings
{
public partial class SettingsManager
{
// 默认下载完成后的操作
private readonly AfterDownloadOperation afterDownload = AfterDownloadOperation.NONE;
// 是否监听剪贴板
private readonly AllowStatus isListenClipboard = AllowStatus.YES;
// 视频详情页面是否自动解析
private readonly AllowStatus isAutoParseVideo = AllowStatus.NO;
// 默认的视频解析项
private readonly ParseScope parseScope = ParseScope.NONE;
// 下载完成列表排序
private readonly DownloadFinishedSort finishedSort = DownloadFinishedSort.DOWNLOAD;
///
/// 获取下载完成后的操作
///
///
public AfterDownloadOperation GetAfterDownloadOperation()
{
appSettings = GetSettings();
if (appSettings.Basic.AfterDownload == AfterDownloadOperation.NOT_SET)
{
// 第一次获取,先设置默认值
SetAfterDownloadOperation(afterDownload);
return afterDownload;
}
return appSettings.Basic.AfterDownload;
}
///
/// 设置下载完成后的操作
///
///
///
public bool SetAfterDownloadOperation(AfterDownloadOperation afterDownload)
{
appSettings.Basic.AfterDownload = afterDownload;
return SetSettings();
}
///
/// 是否监听剪贴板
///
///
public AllowStatus IsListenClipboard()
{
appSettings = GetSettings();
if (appSettings.Basic.IsListenClipboard == AllowStatus.NONE)
{
// 第一次获取,先设置默认值
IsListenClipboard(isListenClipboard);
return isListenClipboard;
}
return appSettings.Basic.IsListenClipboard;
}
///
/// 是否监听剪贴板
///
///
///
public bool IsListenClipboard(AllowStatus isListen)
{
appSettings.Basic.IsListenClipboard = isListen;
return SetSettings();
}
///
/// 视频详情页面是否自动解析
///
///
public AllowStatus IsAutoParseVideo()
{
appSettings = GetSettings();
if (appSettings.Basic.IsAutoParseVideo == AllowStatus.NONE)
{
// 第一次获取,先设置默认值
IsAutoParseVideo(isAutoParseVideo);
return isAutoParseVideo;
}
return appSettings.Basic.IsAutoParseVideo;
}
///
/// 视频详情页面是否自动解析
///
///
///
public bool IsAutoParseVideo(AllowStatus IsAuto)
{
appSettings.Basic.IsAutoParseVideo = IsAuto;
return SetSettings();
}
///
/// 获取视频解析项
///
///
public ParseScope GetParseScope()
{
appSettings = GetSettings();
if (appSettings.Basic.ParseScope == ParseScope.NOT_SET)
{
// 第一次获取,先设置默认值
SetParseScope(parseScope);
return parseScope;
}
return appSettings.Basic.ParseScope;
}
///
/// 设置视频解析项
///
///
///
public bool SetParseScope(ParseScope parseScope)
{
appSettings.Basic.ParseScope = parseScope;
return SetSettings();
}
///
/// 获取下载完成列表排序
///
///
public DownloadFinishedSort GetDownloadFinishedSort()
{
appSettings = GetSettings();
if (appSettings.Basic.DownloadFinishedSort == DownloadFinishedSort.NOT_SET)
{
// 第一次获取,先设置默认值
SetDownloadFinishedSort(finishedSort);
return finishedSort;
}
return appSettings.Basic.DownloadFinishedSort;
}
///
/// 设置下载完成列表排序
///
///
///
public bool SetDownloadFinishedSort(DownloadFinishedSort finishedSort)
{
appSettings.Basic.DownloadFinishedSort = finishedSort;
return SetSettings();
}
}
}