/// <summary>
 /// Sets the working directory of the folders
 /// </summary>
 /// <param name="rootDirectory">The root directory for the Folders</param>
 public void SetWorkingDirectory(string rootDirectory)
 {
     // Create Folders structure
     if (!String.IsNullOrEmpty(_Key))
     {
         Folders = new WorkingFolders(System.IO.Path.Combine(rootDirectory, Key), GroupingOption);
     }
     else
     {
         Folders = new WorkingFolders(System.IO.Path.Combine(rootDirectory, "UndefinedSmtp"), GroupingOption);
     }
 }
        public void UpdateCollection(IEnumerable <WorkingFolderViewModel> folders)
        {
            //WorkingFolders.UpdateCollection(folders);
            IEnumerable <WorkingFolderViewModel> workingFolderViewModels = folders as WorkingFolderViewModel[] ?? folders.ToArray();

            if (WorkingFolders != null && WorkingFolders.Any())
            {
                foreach (var model in WorkingFolders)
                {
                    DetachHandlers(model);
                }
            }

            WorkingFolders = new ObservableCollection <WorkingFolderViewModel>(workingFolderViewModels);
            foreach (var folderViewModel in workingFolderViewModels)
            {
                WorkingFolderViewModel model = folderViewModel;
                eventHandlers.Add(folderViewModel?.OnChange(() => model.Projects, RaiseContainedProjectsChanged), model);
            }
            RaisePropertiesChanged(() => ProjectCount, () => HasProjects);
        }