mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
32 lines
794 B
C#
32 lines
794 B
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; set; }
|
|
public string FilePath { get; set; }
|
|
public string FileSuffix { get; set; }
|
|
public string DirectoryPath { get; set; }
|
|
public string DirectoryName { get; set; }
|
|
|
|
protected Storage()
|
|
{
|
|
DataType = typeof (T);
|
|
FileName = DataType.Name;
|
|
DirectoryPath = Constant.DataDirectory;
|
|
}
|
|
|
|
protected void ValidateDirectory()
|
|
{
|
|
if (!Directory.Exists(DirectoryPath))
|
|
{
|
|
Directory.CreateDirectory(DirectoryPath);
|
|
}
|
|
}
|
|
}
|
|
}
|