Esempio n. 1
0
        public override IAsyncOperation <BaseStorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option)
        {
            return(AsyncInfo.Run(async(cancellationToken) =>
            {
                using var ftpClient = GetFtpClient();
                if (!await ftpClient.EnsureConnectedAsync())
                {
                    return null;
                }

                BaseStorageFolder destFolder = destinationFolder.AsBaseStorageFolder();
                BaseStorageFile file = await destFolder.CreateFileAsync(desiredNewName, option.Convert());

                var stream = await file.OpenStreamForWriteAsync();
                return await ftpClient.DownloadAsync(stream, FtpPath, token: cancellationToken) ? file : null;
            }));
        }
Esempio n. 2
0
 public ZipStorageFile(string path, string containerPath, BaseStorageFile backingFile) : this(path, containerPath)
     => this.backingFile = backingFile;