2016-04-21 08:53:21 +08:00
|
|
|
|
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-21 08:53:21 +08:00
|
|
|
|
{
|
2016-04-27 05:45:31 +08:00
|
|
|
|
public PluginJsonStorage()
|
2016-04-21 08:53:21 +08:00
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|