mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Moved application code to the Application layer
Imported Win10 project Code cleanup WIP - Use common UWP services for Win8.1 and Win10
This commit is contained in:
@@ -6,21 +6,14 @@ namespace ModernKeePass.Infrastructure.File
|
||||
{
|
||||
public class CsvImportFormat: IImportFormat
|
||||
{
|
||||
private readonly IFileProxy _fileService;
|
||||
private const bool HasHeaderRow = true;
|
||||
private const char Delimiter = ';';
|
||||
private const char LineDelimiter = '\n';
|
||||
|
||||
public CsvImportFormat(IFileProxy fileService)
|
||||
{
|
||||
_fileService = fileService;
|
||||
}
|
||||
|
||||
public async Task<List<Dictionary<string, string>>> Import(string path)
|
||||
|
||||
public async Task<List<Dictionary<string, string>>> Import(IList<string> fileContents)
|
||||
{
|
||||
var parsedResult = new List<Dictionary<string, string>>();
|
||||
var content = await _fileService.OpenTextFile(path);
|
||||
foreach (var line in content)
|
||||
foreach (var line in fileContents)
|
||||
{
|
||||
var fields = line.Split(Delimiter);
|
||||
var recordItem = new Dictionary<string, string>();
|
||||
|
Reference in New Issue
Block a user