mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
WIP Clean Architecture
Windows 8.1 App Uses keepasslib v2.44 (temporarily)
This commit is contained in:
37
ModernKeePass.Application.12/Services/FileService.cs
Normal file
37
ModernKeePass.Application.12/Services/FileService.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
namespace ModernKeePass.Application.Services
|
||||
{
|
||||
public class FileService: IFileService
|
||||
{
|
||||
private readonly IFileProxy _fileProxy;
|
||||
|
||||
public FileService(IFileProxy fileProxy)
|
||||
{
|
||||
_fileProxy = fileProxy;
|
||||
}
|
||||
|
||||
public Task<byte[]> OpenBinaryFile(string path)
|
||||
{
|
||||
return _fileProxy.OpenBinaryFile(path);
|
||||
}
|
||||
|
||||
public Task WriteBinaryContentsToFile(string path, byte[] contents)
|
||||
{
|
||||
return _fileProxy.WriteBinaryContentsToFile(path, contents);
|
||||
}
|
||||
|
||||
public Task<IList<string>> OpenTextFile(string path)
|
||||
{
|
||||
return _fileProxy.OpenTextFile(path);
|
||||
}
|
||||
|
||||
public void ReleaseFile(string path)
|
||||
{
|
||||
_fileProxy.ReleaseFile(path);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user