Esempio n. 1
0
    /// <summary>
    /// Async. Uses the download service to initiate a download of selected
    /// basket images, given a particular config - e.g., whether the images
    /// should be resized, watermarked, etc.
    /// </summary>
    /// <param name="config">Download configuration with size and watermark settings</param>
    /// <param name="keepPaths">True to keep folder structure, false for a flat zip of images.</param>
    /// <param name="OnProgress">Callback to give progress information to the UI</param>
    /// <returns>String path to the generated file, which is passed back to the doanload request</returns>
    /// TODO: Maybe move this elsewhere.
    public async Task <string> DownloadSelection(ExportConfig config)
    {
        var virtualZipPath = await _downloadService.CreateDownloadZipAsync(BasketImages, config);

        if (!string.IsNullOrEmpty(virtualZipPath))
        {
            _statusService.StatusText = $"Basket selection downloaded to {virtualZipPath}.";
            Logging.Log($"Basket selection downloaded to {virtualZipPath}.");

            return(virtualZipPath);
        }

        return(string.Empty);
    }