mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 12:09:18 +08:00
dc3b01dc15
1. Fix can't find Result.ctor bug for plugin introduced in c0889de1f9ae460b2cc189eb59e5bd90ddb7d17e 2. use %APPDATA% for all data, part of #389 3. MISC
47 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|