Example #1
0
        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;
                }
            }
        }
        private void PrepareForImport(Options[] options, Action <string> logger)
        {
            var folderIdsByName = _session.GetFoldersByName();

            foreach (var profile in options)
            {
                var folder = folderIdsByName.GetOrDefault(profile.OutlookFolderEntryId)?.FirstOrDefault();
                if (folder != null)
                {
                    profile.OutlookFolderEntryId = folder.EntryId;
                    profile.OutlookFolderStoreId = folder.StoreId;

                    profile.OutlookFolderAccountName = _optionTasks.GetFolderAccountNameOrNull(profile.OutlookFolderStoreId);
                }
                else
                {
                    logger(Strings.Get($"Warning: did not find folder '{profile.OutlookFolderEntryId}'"));
                    profile.OutlookFolderEntryId     = null;
                    profile.OutlookFolderStoreId     = null;
                    profile.OutlookFolderAccountName = null;
                }
            }
        }
 public void UpdateFolderAccountName()
 {
     FolderAccountName = _selectedFolder != null
   ? _optionTasks.GetFolderAccountNameOrNull(_selectedFolder.StoreId)
   : null;
 }