public virtual void OnProgress(UpdateProgressInfo pi)
 {
     if (ProgressDelegate != null)
         ProgressDelegate(pi);
 }
Beispiel #2
0
		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);
		}
Beispiel #3
0
        private void TaskProgressCallback(UpdateProgressInfo currentStatus, IUpdateTask task)
        {
            if (ReportProgress == null) return;

            currentStatus.TaskDescription = task.Description;
            currentStatus.TaskId = UpdatesToApply.IndexOf(task) + 1;

            var taskPerc = 100 / UpdatesToApply.Count;
            currentStatus.Percentage = (currentStatus.Percentage * taskPerc / 100) + (currentStatus.TaskId - 1) * taskPerc;

            ReportProgress(currentStatus);
        }