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