mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
24 lines
663 B
C#
24 lines
663 B
C#
![]() |
using ModernKeePass.Interfaces;
|
|||
|
using Windows.Storage;
|
|||
|
using ModernKeePass.ViewModels;
|
|||
|
|
|||
|
namespace ModernKeePass.Services
|
|||
|
{
|
|||
|
public class ImportService : IImportService<IFormat>
|
|||
|
{
|
|||
|
public void Import(IFormat format, IStorageFile source, IDatabaseService databaseService)
|
|||
|
{
|
|||
|
var entities = (GroupVm)format.Import(source);
|
|||
|
|
|||
|
foreach (var entry in entities.Entries)
|
|||
|
{
|
|||
|
databaseService.RootGroup.Entries.Add(entry);
|
|||
|
}
|
|||
|
|
|||
|
foreach (var subGroup in entities.Groups)
|
|||
|
{
|
|||
|
databaseService.RootGroup.Groups.Add(subGroup);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|