public virtual void OnProgress(UpdateProgressInfo pi) { if (ProgressDelegate != null) ProgressDelegate(pi); }
private void TaskProgressCallback(UpdateProgressInfo currentStatus, IUpdateTask task) { if (ReportProgress == null) return; currentStatus.TaskDescription = task.Description; currentStatus.TaskId = UpdatesToApply.IndexOf(task) + 1; //This was an assumed int, which meant we never reached 100% with an odd number of tasks float taskPerc = 100F / UpdatesToApply.Count; currentStatus.Percentage = (int)Math.Round((currentStatus.Percentage * taskPerc / 100) + (currentStatus.TaskId - 1) * taskPerc); ReportProgress(currentStatus); }