use %APPDATA%

1. Fix can't find Result.ctor bug for plugin introduced in
c0889de1f9ae460b2cc189eb59e5bd90ddb7d17e
2. use %APPDATA% for all data, part of #389
3. MISC
This commit is contained in:
bao-qian
2016-04-27 02:15:53 +01:00
parent e96bd5a0e7
commit dc3b01dc15
22 changed files with 157 additions and 159 deletions

View File

@@ -0,0 +1,46 @@
using System;
using System.IO;
namespace Wox.Infrastructure.Storage
{
public class Storage<T>
{
protected T Data;
protected Type DataType { get; }
public string FileName { get; }
public string FilePath { get; set; }
public string FileSuffix { get; set; }
public string DirectoryPath { get; set; }
public string DirectoryName { get; set; }
public virtual T Load()
{
throw new NotImplementedException();
}
public virtual void Save()
{
throw new NotImplementedException();
}
public virtual void LoadDefault()
{
throw new NotImplementedException();
}
protected Storage()
{
DataType = typeof (T);
FileName = DataType.Name;
DirectoryPath = Wox.DataPath;
}
protected void ValidateDirectory()
{
if (!Directory.Exists(DirectoryPath))
{
Directory.CreateDirectory(DirectoryPath);
}
}
}
}