2017-12-01 17:59:38 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using ModernKeePass.Interfaces;
|
|
|
|
|
using Windows.Storage;
|
2018-09-12 12:58:32 +02:00
|
|
|
|
using System.Collections.Generic;
|
2017-12-01 17:59:38 +01:00
|
|
|
|
|
|
|
|
|
namespace ModernKeePassApp.Test.Mock
|
|
|
|
|
{
|
2018-02-23 18:09:21 +01:00
|
|
|
|
class RecentServiceMock : IRecentService
|
2017-12-01 17:59:38 +01:00
|
|
|
|
{
|
2018-09-12 12:58:32 +02:00
|
|
|
|
private Dictionary<string, IStorageItem> _recentItems = new Dictionary<string, IStorageItem>();
|
|
|
|
|
|
2017-12-01 17:59:38 +01:00
|
|
|
|
public int EntryCount => 0;
|
|
|
|
|
|
|
|
|
|
public void Add(IStorageItem file, string metadata)
|
|
|
|
|
{
|
2018-09-12 12:58:32 +02:00
|
|
|
|
_recentItems.Add(metadata, file);
|
2017-12-01 17:59:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-04 12:20:05 +01:00
|
|
|
|
public void ClearAll()
|
|
|
|
|
{
|
2018-09-12 12:58:32 +02:00
|
|
|
|
_recentItems.Clear();
|
2017-12-04 12:20:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-01 17:59:38 +01:00
|
|
|
|
public ObservableCollection<IRecentItem> GetAllFiles(bool removeIfNonExistant = true)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Task<IStorageItem> GetFileAsync(string token)
|
|
|
|
|
{
|
2018-09-12 12:58:32 +02:00
|
|
|
|
return Task.Run(() => _recentItems[token]);
|
2017-12-01 17:59:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|