Files
modernkeepass/ModernKeePass.Application/Services/RecentService.cs
Geoffroy BONNEVILLE 7e44d47065 WIP Clean Architecture
Windows 8.1 App Uses keepasslib v2.44 (temporarily)
2020-03-24 13:01:14 +01:00

40 lines
991 B
C#

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();
}
}
}