Subject: FileSystemProgressEventArgs e.UserObject is null
Date: 2012-03-04 04:37:06
From: Jon Reis
Source: filesystemprogresseventargs-e-userobject-null

Hello, so far I like the design of your FTP/FTPS components. They look well done.
I have a question about the UserObject in the callback Ftp.Progress callback. I'm calling the following code:

FileStream fs = new FileStream(tempFile, FileMode.OpenOrCreate);
MessageCollectionView mv= new MessageCollectionView();
_client.BeginDownloadFile(item.Text, fs, mv);

In the client callback, I'm calling:

case TransferState.Downloading:
  // Source file is being downloaded to the local disk.
  time = Environment.TickCount;
  if (time - _timeLastEvent >= 1000  && e.BytesPerSecond > 0)
    _timeLastEvent = time;
    var mv = e.UserObject as MessageCollectionView;

I'm expecting e.UserObject to contain my object that I passed into the BeginDownloadFile function, however; it is always null.
Am I doing something wrong here?

Thanks in advance. ---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index