Pass a unique reference to TransferProgressChanged

0 votes
asked Apr 17, 2015 by maynero (390 points)

I have DataGridView that list all the files to upload simultaneously.
Since TransferProgressChanged is available to the all upload/download session, can I pass a unique reference such as row number so that I can easily update rows in DataGridView for the progress?

I don't prefer the Async version for upload/download since I'm having hard time dealing with the retry logic.

Applies to: Rebex SFTP

1 Answer

0 votes
answered Apr 20, 2015 by Tomas Knopp (58,580 points)

The TransferProgressChanged event is raised internally, so there is none such possibility to pass some unique reference there.

The one reference that I thought that you could use with combination of the simple sync PutFile / GetFile methods to differentiate the correct row in your DataGridView would be using the SftpProblemDetectedEventArgs.LocalPath or SftpProblemDetectedEventArgs.RemotePath to differentiate which transferring file have changed its progress.

void sftp_ProblemDetected(object sender, SftpProblemDetectedEventArgs e)
{
    Console.WriteLine(e.LocalPath);
    Console.WriteLine(e.RemotePath);
}
...