Today a quick tip, easy to code but hard to find if you don’t know where to look for : how to cancel a DownloadOperation !
There is some useful methods on the DownloadOperation : Resume, Pause, Start … but wait there is no “Stop” ??
In fact, you have to attach the operation to your app before to be able to cancel it. The code is then really easy :
[csharp]theDownloadOperation.AttachAsync().Cancel();[/csharp]
Now you know how download operations are canceled in this beautiful Dropbox Client for Windows 8 : 8 Files In A Box !
05/02/2013 13 h 37 min
How to do the same thing in C#/XAML ?
05/02/2013 13 h 39 min
Exactly the same code… these are WinRT API/objects 🙂
06/02/2013 6 h 24 min
I am not getting. Suppose this line is for downloading the file then how to cancel it ?
LiveDownloadOperationResult result = await liveClient.BackgroundDownloadAsync(string.Format("{0}/content", FileID));
26/02/2013 13 h 31 min
Hello Farhan,
I was referencing this API : http://msdn.microsoft.com/en-us/library/windows/a…
Regards,
26/02/2013 13 h 41 min
Then how can I do stop/resume while downloading/uploading files to/from SkyDrive ?
16/03/2013 15 h 13 min
I don\’t know I never used this… sorry
20/02/2016 4 h 31 min
Nice tips, thanks for share