Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: BeginSynchronizeDirectories Example

$
0
0
Does anyone have an example usage of BeginSynchronizeDirectories? I'm currently using this statement:
IEnumerable<FileInfo> fileInfo = sftpClient.SynchronizeDirectories(sourceDirectory, destinationDirectory, "*");
But obviously in the GUI it freezes up as the directories are being synced because it's not asynchronous.

My main question is, dealing with the state object and the asynchronous call back, so my existing code is:
IAsyncResult asyncResult = sftpClient.BeginSynchronizeDirectories(sourceDirectory, destinationDirectory, "*", sftpAsyncSynchronizeDirectoriesCallback, sftpState);
            if (asyncResult.IsCompleted)
But I'm not sure how to handle the state and callback...what I'd really like is to display back to my user a progress bar or some sort of indicator about the status of the directories as they're synchronized.

I've searched google/bing but not finding any results other than the method description.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>