2016-04-21 08:53:21 +08:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace Wox.Infrastructure.Storage
|
|
|
|
|
{
|
2016-04-27 05:45:31 +08:00
|
|
|
|
public class PluginJsonStorage<T> :JsonStrorage<T> where T : new()
|
2016-04-21 08:53:21 +08:00
|
|
|
|
{
|
2016-04-27 05:45:31 +08:00
|
|
|
|
public PluginJsonStorage()
|
2016-04-21 08:53:21 +08:00
|
|
|
|
{
|
|
|
|
|
// C# releated, add python releated below
|
2017-02-07 08:21:39 +08:00
|
|
|
|
var dataType = typeof(T);
|
|
|
|
|
var assemblyName = typeof(T).Assembly.GetName().Name;
|
|
|
|
|
DirectoryPath = Path.Combine(Constant.DataDirectory, DirectoryName, Constant.Plugins, assemblyName);
|
|
|
|
|
Helper.ValidateDirectory(DirectoryPath);
|
2016-04-27 09:15:53 +08:00
|
|
|
|
|
2017-02-07 08:21:39 +08:00
|
|
|
|
FilePath = Path.Combine(DirectoryPath, $"{dataType.Name}{FileSuffix}");
|
2016-04-21 08:53:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|