mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
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:
46
Wox.Infrastructure/Storage/Storage.cs
Normal file
46
Wox.Infrastructure/Storage/Storage.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user