示例#1
0
        private async void AddFolder()
        {
            if (AddingFiles)
            {
                return;
            }

            if (_dialogs.AddFolderDialog(out var folderPath))
            {
                if (_dialogs.AddFolderOptionsDialog(folderPath,
                                                    out var includeSunfolder,
                                                    out var includeFiles,
                                                    out var extension))
                {
                    try
                    {
                        AddingFiles = true;
                        var fileNames = _fileFinder.GetFiles(folderPath, includeSunfolder, includeFiles, extension);
                        await UploadFiles.AddNewRangeAsync(fileNames);
                    }
                    catch (Exception ex)
                    {
                        _dialogs.ErrorMessage(Resources.UnableToAddFiles, ex);
                    }
                    finally
                    {
                        AddingFiles = false;
                    }
                }
            }
        }