Пример #1
0
 public virtual void OnProgress(UpdateProgressInfo pi)
 {
     if (ProgressDelegate != null)
         ProgressDelegate(pi);
 }
Пример #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);
		}
Пример #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);
        }