mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
25 lines
767 B
C#
25 lines
767 B
C#
using System.IO;
|
|
using Flow.Launcher.Infrastructure.UserSettings;
|
|
|
|
namespace Flow.Launcher.Infrastructure.Storage
|
|
{
|
|
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
|
|
{
|
|
public PluginJsonStorage()
|
|
{
|
|
// 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}");
|
|
}
|
|
|
|
public PluginJsonStorage(T data) : this()
|
|
{
|
|
Data = data;
|
|
}
|
|
}
|
|
}
|
|
|