public override async Task DownloadFileAsync(DriveFile driveFile, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token) { // TODO: use actionIfFileExists using (var output = File.OpenWrite(destFolder + Path.DirectorySeparatorChar + driveFile.Name)) { await DownloadFileAsync(driveFile, output, token); } }
public override async Task DownloadFileAsync(StorageFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action <TransferProgress> progressCallback) { using (var output = File.OpenWrite(Common.AppendToPath(destFolder, file.Name))) { await DownloadFileAsync(file, output, token, progressCallback); } }
public override async Task DownloadFileAsync(DriveFile driveFile, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token) { var fileName = Common.AppendToPath(destFolder, driveFile.Name); if (System.IO.File.Exists(fileName)) { switch (actionIfFileExists) { case ActionIfFileExists.Skip: return; case ActionIfFileExists.Rewrite: fileName = GetAvailableFileName(fileName); break; } } using (var fileStream = System.IO.File.Create(fileName)) { await DownloadFileAsync(driveFile, fileStream, token); } }
public override Task DownloadFileAsync(StorageFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action<TransferProgress> progressCallback) { throw new NotImplementedException(); }
/// <summary> /// Download folder or file from storage (not from drive). /// </summary> /// <param name="destFolder">Path of folder whare to nest a downloaded file or folder. /// For example if <paramref name="file"/> is "/photo2010/egypt" and <paramref name="destFolder"/> /// is "d:/photos", then in "photos" folder will be created subfolder "egypt" with downloaded files. /// </param> public async Task DownloadFileFromStorageAsync(AccountFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action <TransferProgress> progressCallback) { await Storage.DownloadFileAsync(file.StorageFile, destFolder, actionIfFileExists, token, progressCallback); }
public async Task DownloadFileFromDriveAsync(AccountFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token) { foreach (var drive in Drives) { try { await drive.DownloadFileAsync(file.GetDriveFile(drive), destFolder, actionIfFileExists, token); return; } catch (Exception ex) { OnError(ex); } } throw new Exception("Can't download this file"); }
public abstract Task DownloadFileAsync(StorageFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action<TransferProgress> progressCallback);
public abstract Task DownloadFileAsync(DriveFile driveFile, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token);
public abstract Task DownloadFileAsync(StorageFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action <TransferProgress> progressCallback);
/// <summary> /// Download folder or file from storage (not from drive). /// </summary> /// <param name="destFolder">Path of folder whare to nest a downloaded file or folder. /// For example if <paramref name="file"/> is "/photo2010/egypt" and <paramref name="destFolder"/> /// is "d:/photos", then in "photos" folder will be created subfolder "egypt" with downloaded files. /// </param> public async Task DownloadFileFromStorageAsync(AccountFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action<TransferProgress> progressCallback) { await Storage.DownloadFileAsync(file.StorageFile, destFolder, actionIfFileExists, token, progressCallback); }
public override async Task DownloadFileAsync(DriveFile driveFile, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token) { throw new NotImplementedException(); }
public override Task DownloadFileAsync(DriveFile driveFile, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token) { return(Task.FromResult(0)); }
public override Task DownloadFileAsync(StorageFile file, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token, Action <TransferProgress> progressCallback) { throw new NotImplementedException(); }
public async Task DownloadFileAsync(DriveFileCollection driveFile, string destFolder, ActionIfFileExists actionIfFileExists, CancellationToken token) { var file = driveFile.First(x => !x.Drive.IsIgnored); await file.Drive.DownloadFileAsync(file, destFolder, actionIfFileExists, token); }