mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 16:10:16 -04:00

Refactor the Database Service (no more enum, ...) Restored the Donate page with Paypal web page Added (but not working) MS App Center integration Corrected tests accordingly WIP AOP to detect database changes
30 lines
674 B
C#
30 lines
674 B
C#
using System.Threading.Tasks;
|
|
using Windows.Storage;
|
|
using ModernKeePass.Interfaces;
|
|
using ModernKeePass.Services;
|
|
|
|
namespace ModernKeePass.ViewModels
|
|
{
|
|
public class SaveVm
|
|
{
|
|
private readonly IDatabaseService _database;
|
|
public SaveVm() : this(DatabaseService.Instance) { }
|
|
|
|
public SaveVm(IDatabaseService database)
|
|
{
|
|
_database = database;
|
|
}
|
|
|
|
public async Task Save(bool close = true)
|
|
{
|
|
_database.Save();
|
|
if (close)
|
|
await _database.Close();
|
|
}
|
|
|
|
public void Save(StorageFile file)
|
|
{
|
|
_database.Save(file);
|
|
}
|
|
}
|
|
} |