This project is read-only.

BeginSynchronizeDirectories Example

Feb 6, 2015 at 6:57 PM
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.