mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00

Set credentials validation works as intended Getting settings has default values Add parent group in Move searchbox Moving entries work as intended Removed unreferenced code files
54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using ModernKeePass.Application.Common.Interfaces;
|
|
using ModernKeePass.Common;
|
|
|
|
namespace ModernKeePass.ViewModels.ListItems
|
|
{
|
|
public class SettingsNewVm
|
|
{
|
|
private readonly ISettingsProxy _settings;
|
|
|
|
public SettingsNewVm(ISettingsProxy settings)
|
|
{
|
|
_settings = settings;
|
|
}
|
|
|
|
public bool IsCreateSample
|
|
{
|
|
get { return _settings.GetSetting(Constants.Settings.Sample, true); }
|
|
set { _settings.PutSetting(Constants.Settings.Sample, value); }
|
|
}
|
|
|
|
public IEnumerable<DatabaseFormat> FileFormats => new []
|
|
{
|
|
new DatabaseFormat
|
|
{
|
|
Version = "4",
|
|
DisplayText = "4 (Argon2, ChaCha20)"
|
|
},
|
|
new DatabaseFormat
|
|
{
|
|
Version = "3",
|
|
DisplayText = "3 (AES-KDF, AES/Rijndael)"
|
|
}
|
|
};
|
|
|
|
public DatabaseFormat DatabaseFormatVersion
|
|
{
|
|
get
|
|
{
|
|
var version = _settings.GetSetting(Constants.Settings.DefaultFileFormat, "4");
|
|
return FileFormats.FirstOrDefault(f => f.Version == version);
|
|
}
|
|
set { _settings.PutSetting(Constants.Settings.DefaultFileFormat, value.Version); }
|
|
}
|
|
}
|
|
|
|
public class DatabaseFormat
|
|
{
|
|
public string Version { get; set; }
|
|
public string DisplayText { get; set; }
|
|
}
|
|
}
|