PowerToys/Wox.Infrastructure/Storage/Storage.cs
bao-qian dc3b01dc15 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
2016-04-27 02:35:17 +01:00

47 lines
1.1 KiB
C#

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);
}
}
}
}