What is the logic behind the DoneEvent? - WeOnlyDo Discussion board

What is the logic behind the DoneEvent? (wodFtpDLX / wodFtpDLX.NET)

by tonym, Tuesday, October 06, 2015, 06:17 (3118 days ago)

I'm using FtpDLX.Net and just like the other WOD controls I use I love it. It is a vast improvement over the last FTP control I had.

That said, I'm a but puzzled by the use of the DoneEvent that is called for multiple methods such as LisrDir, PutFile, GetFile and so on. It seems to be counter-productive. For example:

I want to issue a

ftp1.MakeDir(path)
ftp1.RemotePath = path
ftp1.PutFile(LocalPath, RemotePath)

in that order. The problem is that as soon as the ftp1.MakeDir is issued it immediately tries to issue the ftp1.RemotePath and then the ftp1.PutFile, all before MakeDir is completed. Now, I know that after I issue the MakeDir I'm supposed to wait for the DoneEvent to fire before issuing the RemotePath but I have no idea how to "pause" execution until the DoneEvent fires. What I end up with is having to put RemotePath and PutFile in the DoneEvent as well as for the ListDir and so on.

Surely there is a better way to do this. I wish these methods were synchronous so that when one is issued the program would wait for it to complete before proceeding.

Any suggestions?


Complete thread: