private void PrepareForImport(Options[] options, Action<string> logger)
{
var folderIdsByName = new Dictionary<string, List<Tuple<string, string>>>();
AddFoldersRecusive(_session.Folders, folderIdsByName);
foreach (var profile in options)
{
var ids = folderIdsByName.GetOrAdd(profile.OutlookFolderEntryId).FirstOrDefault();
if (ids != null)
{
profile.OutlookFolderEntryId = ids.Item1;
profile.OutlookFolderStoreId = ids.Item2;
profile.OutlookFolderAccountName = _optionTasks.GetFolderAccountNameOrNull(profile.OutlookFolderStoreId);
}
else
{
logger($"Warning: did not find Folder '{profile.OutlookFolderEntryId}'");
profile.OutlookFolderEntryId = null;
profile.OutlookFolderStoreId = null;
profile.OutlookFolderAccountName = null;
}
}
}