Flow.Launcher/Flow.Launcher.Infrastructure/Storage/PluginJsonStorage.cs

26 lines
768 B
C#
Raw Normal View History

using System.IO;
2020-04-21 09:12:17 +00:00
using Flow.Launcher.Infrastructure.UserSettings;
2020-04-21 09:12:17 +00:00
namespace Flow.Launcher.Infrastructure.Storage
{
2021-06-21 11:31:07 +00:00
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
{
2021-06-21 11:31:07 +00:00
public PluginJsonStorage()
{
2021-05-11 19:10:03 +00:00
// C# related, add python related below
var dataType = typeof(T);
var assemblyName = dataType.Assembly.GetName().Name;
DirectoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName, Constant.Plugins, assemblyName);
Helper.ValidateDirectory(DirectoryPath);
FilePath = Path.Combine(DirectoryPath, $"{dataType.Name}{FileSuffix}");
}
2021-06-21 11:31:07 +00:00
public PluginJsonStorage(T data) : this()
{
_data = data;
}
}
}