mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-08 17:36:30 +03:00
minor changes in RecentFilesService.cs
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using KeyKeeper.Models;
|
using KeyKeeper.Models;
|
||||||
|
|
||||||
@@ -7,13 +8,20 @@ namespace KeyKeeper.Services;
|
|||||||
|
|
||||||
internal class RecentFilesService : IRecentFilesService
|
internal class RecentFilesService : IRecentFilesService
|
||||||
{
|
{
|
||||||
|
private const string RecentFilesFilename = "recent-files.json";
|
||||||
|
|
||||||
// files are stored in reverse chronological order
|
// files are stored in reverse chronological order
|
||||||
public ObservableCollection<RecentFile> RecentFiles { get; }
|
public ObservableCollection<RecentFile> RecentFiles { get; }
|
||||||
private readonly int maxEntries = 8;
|
private readonly int maxEntries = 8;
|
||||||
|
private readonly string recentFilesPath;
|
||||||
|
|
||||||
public RecentFilesService()
|
public RecentFilesService()
|
||||||
{
|
{
|
||||||
RecentFiles = new ObservableCollection<RecentFile>();
|
RecentFiles = new ObservableCollection<RecentFile>();
|
||||||
|
var appDataDirectory = Path.Combine(
|
||||||
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||||
|
"KeyKeeper");
|
||||||
|
recentFilesPath = Path.Combine(appDataDirectory, RecentFilesFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Remember(string filename)
|
public void Remember(string filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user