private void OnCopyPicturesCommand(List <Picture> pictures)
        {
            string folderPath;

            if (_fileExplorerDialogService.ShowFolderBrowserDialog(out folderPath))
            {
                var uncopiedPictures = new List <string>();
                pictures.ToList().ForEach(pic =>
                {
                    if (!_pictureRepository.TryCopy(pic, folderPath).Success.Value)
                    {
                        uncopiedPictures.Add(pic.FullFileName);
                    }
                });

                if (uncopiedPictures.Count > 0)
                {
                    var fileNames = string.Join("\n", uncopiedPictures);
                    _modalDialog.ShowMessage("Failed to copy these pictures", fileNames);
                }
                else
                {
                    _eventAggregator.GetEvent <StatusTextHelpInfoEvent>().Publish("All Pictures have successfully copied");
                }
            }
        }
Beispiel #2
0
        private async void OnOpenFolderCommand(SearchOption option)
        {
            string selectedPath;

            if (_fileExplorerDialogService.ShowFolderBrowserDialog(out selectedPath))
            {
                if (option == SearchOption.AllDirectories)
                {
                    FolderTreeViewModel.TryLoad(selectedPath);
                }

                SelectedPictureGridViewModel = await LoadAPictureGridViewModel(selectedPath);
            }
        }