PowerToys/Wox.UpdateFeedGenerator/ConfigStorage.cs

46 lines
1.1 KiB
C#
Raw Normal View History

2015-10-31 07:17:34 +08:00
using System.IO;
2015-01-22 22:57:54 +08:00
using System.Reflection;
using Newtonsoft.Json;
using Wox.Infrastructure.Storage;
namespace Wox.UpdateFeedGenerator
{
public class ConfigStorage : JsonStrorage<ConfigStorage>
{
[JsonProperty]
public string OutputDirectory { get; set; }
[JsonProperty]
public string SourceDirectory { get; set; }
[JsonProperty]
public string BaseURL { get; set; }
[JsonProperty]
public string FeedXMLName { get; set; }
[JsonProperty]
public bool CheckVersion { get; set; }
[JsonProperty]
public bool CheckSize { get; set; }
[JsonProperty]
public bool CheckDate { get; set; }
[JsonProperty]
public bool CheckHash { get; set; }
protected override void OnAfterLoad(ConfigStorage config)
{
if (string.IsNullOrEmpty(config.OutputDirectory))
{
config.OutputDirectory = @"Update";
2016-01-07 05:34:42 +08:00
Instance.Save();
2015-01-22 22:57:54 +08:00
}
}
2016-01-07 10:31:17 +08:00
protected override string FileName { get; } = "config";
2015-01-22 22:57:54 +08:00
}
}