Evaluating SharpBits...questions

Mar 2, 2011 at 8:34 PM

Hi,

I'm evaluating SharpBits for use in a project and have noticed the following:

I'm catching the OnJobTransferred event in order to notify the user that the file has downloaded.  But I found that the event args parameter of the OnJobTransferred event doesn't contain any reference to the job that has actually completed.  It seems silly to have to walk thru the EnumJobs list to find which may have just completed.  Is there a reason why the NotificationEventArgs gets converted to a "new JobNotificationEventArgs" in JobTransferred in BitsJob.cs?  I tried changing that to pass thru the NotificationEventArgs which does include the Job and that seems to work ok in my limited testing.

Secondly, after making the above change I found that the "File" property of the NotificationEventArgs is null.  By adding "job.EnumFiles();" just before line 131 of BitsNotification.cs I'm able to get the files that were in the job and that also seems to work ok.

Both of these issues seem so obvious that I can't believe that no one has noticed them yet...or am I missing something/have the wrong version of the source code, etc or is there a good reason why the app is coded this way?

Thanks,

Glenn

Mar 3, 2011 at 9:13 AM

Hi,

I ask myself exactly the same questions.
Does anybody give us some links to better understand ?

I also noticed that I can't remove jobs.
When relaunching my application, calling manager.EnumJobs(JobOwner.CurrentUser) retrieves all the jobs I previously removed...
Can anyone tell me how this works ? Where are jobs stored ?

Thanks by advance,

Regards,

Jerome.

Mar 3, 2011 at 9:21 AM
Edited Mar 3, 2011 at 9:22 AM

Sorry. I found an answer to the second part of the previous post :

It seems that bitsJob.Cancel() method call does the trick for removing a job instead of bitsManager.Jobs.Remove(guid)...

Jerome.