private void notificationHandler_OnJobModifiedEvent(object sender, NotificationEventArgs e) { // route the event to the job if (this.jobs.ContainsKey(e.Job.JobId)) { BitsJob job = this.jobs[e.Job.JobId]; job.JobModified(sender, e); } //publish the event to other subscribers if (this.onJobModified != null) this.onJobModified(sender, e); }
public void downloadManager_OnJobModified(object sender, NotificationEventArgs e) { foreach (DataGridViewRow row in dataGridView1.Rows) { if (e.Job.JobId.ToString() == row.Cells[_colIDs.ID].Value.ToString()) { row.Cells[_colIDs.Progress].Value = String.Format("{0}/{1}", e.Job.Progress.BytesTransferred, e.Job.Progress.BytesTotal); row.Cells[_colIDs.Status].Value = e.Job.State.ToString(); } } Console.WriteLine("Job {0} was modified.", e.Job.JobId); }
internal void JobModified(object sender, NotificationEventArgs e) { if (this.onJobModified != null) this.onJobModified(sender, new JobNotificationEventArgs()); }
/// <summary>Notifications the handler on job transferred event.</summary> /// <param name="sender">The object that called the event.</param> /// <param name="e">The <c>NotificationEventArgs</c> instance containing the event data.</param> void NotificationHandlerOnJobTransferredEvent(object sender, NotificationEventArgs e) { // route the event to the job if (this.Jobs.ContainsKey(e.Job.JobId)) { BitsJob job = this.Jobs[e.Job.JobId]; job.JobTransferred(sender); } // publish the event to other subscribers if (this.jobTransferred != null) { this.jobTransferred(sender, e); } }
private void downloadManager_OnJobTransferred(object sender, NotificationEventArgs e) { e.Job.Complete(); foreach (DataGridViewRow row in dataGridView1.Rows) { if (e.Job.JobId.ToString() == row.Cells[_colIDs.ID].Value.ToString()) row.Cells[_colIDs.Status].Value = e.Job.State.ToString(); } Console.WriteLine(string.Format("Job {0} was transferred.", e.Job.JobId)); }