Implemented opening/saving themes
This commit is contained in:
36
Filtration.Common/Services/FileSystemService.cs
Normal file
36
Filtration.Common/Services/FileSystemService.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Filtration.Common.Services
|
||||
{
|
||||
public interface IFileSystemService
|
||||
{
|
||||
string ReadFileAsString(string filePath);
|
||||
void WriteFileFromString(string filePath, string inputString);
|
||||
bool DirectoryExists(string directoryPath);
|
||||
string GetUserProfilePath();
|
||||
}
|
||||
|
||||
internal class FileSystemService : IFileSystemService
|
||||
{
|
||||
public string ReadFileAsString(string filePath)
|
||||
{
|
||||
return File.ReadAllText(filePath);
|
||||
}
|
||||
|
||||
public void WriteFileFromString(string filePath, string inputString)
|
||||
{
|
||||
File.WriteAllText(filePath, inputString);
|
||||
}
|
||||
|
||||
public bool DirectoryExists(string directoryPath)
|
||||
{
|
||||
return Directory.Exists(directoryPath);
|
||||
}
|
||||
|
||||
public string GetUserProfilePath()
|
||||
{
|
||||
return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user