PowerToys/Wox.Infrastructure/Storage/PluginJsonStorage.cs

19 lines
609 B
C#
Raw Normal View History

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-27 05:45:31 +08:00
public PluginJsonStorage()
{
// C# releated, add python releated below
var dataType = typeof(T);
var assemblyName = typeof(T).Assembly.GetName().Name;
DirectoryPath = Path.Combine(Constant.DataDirectory, DirectoryName, Constant.Plugins, assemblyName);
Helper.ValidateDirectory(DirectoryPath);
FilePath = Path.Combine(DirectoryPath, $"{dataType.Name}{FileSuffix}");
}
}
}