If you check out the code go to the sample into Program.cs and search for the following lines
// upload a testfile from temp directory into public folder of DropBox
// with progress information
dropBoxStorage.UploadFile(srcFile, publicFolder, UploadDownloadProgress);
As you can see we attach a simple callback to the upload or download method. This call will be triggered every transfered chunk. To calculate the percentages for a progressbar the following parameters in the callback can be used:
sizebystes - contains the amount of bytes which has to be transfered totally
currentbytes - contains the amount of bytes currently transfered
Just calc the percentage value and set the value of your progressbar.
For your other question: Because of an other request I added an appendix in the pdf tutorial which describes the way for WebDav as well. Would be cool to get feedback from your side if something missing.
2011/8/9 maltmann <email@example.com>
i'm playing around with these really nice library since a few days and got some simple CloudStorage tasks working on my apache2 webdav server. I've to say that i've switched from advanced php web development to C# application development only a few weeks
ago - cause of that my understanding in this language is not at a high level. Please be patient ;)
So here is my request: I've been searching this site and the source code unit tests for a easy example for a progress bar implementation. I already found some code snippets that took me to the right way but after all i didn't brought it to a functional state.
So could you anyone here provide me a simple sample how to implement a progress bar into an upload or download function?
An other question is. I made some sample scripts for the webdav connection ( cause it is different from the dropbox samples ). Is there a way to publish it in the Documentation area so that other ppl will have an easier start to webdav?