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:
40
ModernKeePass.Application.12/Services/RecentService.cs
Normal file
40
ModernKeePass.Application.12/Services/RecentService.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Dtos;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
namespace ModernKeePass.Application.Services
|
||||
{
|
||||
public class RecentService: IRecentService
|
||||
{
|
||||
private readonly IRecentProxy _recentProxy;
|
||||
|
||||
public RecentService(IRecentProxy recentProxy)
|
||||
{
|
||||
_recentProxy = recentProxy;
|
||||
}
|
||||
|
||||
public bool HasEntries => _recentProxy.EntryCount > 0;
|
||||
|
||||
public async Task<FileInfo> Get(string token)
|
||||
{
|
||||
return await _recentProxy.Get(token);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<FileInfo>> GetAll()
|
||||
{
|
||||
return await _recentProxy.GetAll();
|
||||
}
|
||||
|
||||
public async Task Add(FileInfo recentItem)
|
||||
{
|
||||
await _recentProxy.Add(recentItem);
|
||||
}
|
||||
|
||||
public void ClearAll()
|
||||
{
|
||||
_recentProxy.ClearAll();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user