mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Remove instance logic for BinaryStorage and JsonStorage, part 1
1. part of #389 2. huge refactoring
This commit is contained in:
20
Wox.Infrastructure/Storage/PluginSettingsStorage.cs
Normal file
20
Wox.Infrastructure/Storage/PluginSettingsStorage.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
public class PluginSettingsStorage<T> :JsonStrorage<T> where T : new()
|
||||
{
|
||||
public PluginSettingsStorage()
|
||||
{
|
||||
var pluginDirectoryName = "Plugins";
|
||||
|
||||
// C# releated, add python releated below
|
||||
var type = typeof (T);
|
||||
FileName = type.Name;
|
||||
var assemblyName = type.Assembly.GetName().Name;
|
||||
DirectoryPath = Path.Combine(WoxDirectroy.Executable, DirectoryName, pluginDirectoryName, assemblyName);
|
||||
|
||||
FilePath = Path.Combine(DirectoryPath, FileName + FileSuffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user